refactor: OpenBao 认证复用 manager Kubernetes client
Verify / test (pull_request) Successful in 4m36s
Verify / lint (pull_request) Successful in 12m25s
Verify / database-integration (pull_request) Successful in 15m49s

This commit is contained in:
2026-09-25 21:38:56 +00:00
parent f0aa86f676
commit c20f8930f0
5 changed files with 56 additions and 31 deletions
+2 -2
View File
@@ -76,9 +76,9 @@ func setupOpenBaoAuthentication(manager ctrl.Manager, options openBaoOptions) er
if err != nil {
return err
}
// 与 reconcile 共用 GetConfig:支持 --kubeconfig/KUBECONFIG 和 in-cluster,绝不推断 Pod 文件位置。
// 复用 manager 已装配的 Kubernetes client,不重复加载配置或创建客户端。
session, err := openbao.NewKubernetesSession(
client, manager.GetConfig(), options.mount, options.role, options.identity,
client, manager.GetClient(), options.mount, options.role, options.identity,
)
if err != nil {
return err