From 23832c8cc7961ba15efb52bbc9ac49651913469e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 10 Feb 2022 12:13:41 +0100 Subject: [PATCH] osd: add namespace in vault client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the KMS connection details for Vault have a VAULT_NAMESPACE we must use it when building the vault client to auto-detect the KV internal version. Signed-off-by: Sébastien Han --- pkg/daemon/ceph/osd/kms/vault_api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/daemon/ceph/osd/kms/vault_api.go b/pkg/daemon/ceph/osd/kms/vault_api.go index cde2be9e6..593ccca7b 100644 --- a/pkg/daemon/ceph/osd/kms/vault_api.go +++ b/pkg/daemon/ceph/osd/kms/vault_api.go @@ -84,6 +84,11 @@ func newVaultClient(clusterdContext *clusterd.Context, namespace string, secretC return nil, err } + // Set the namespace if the config has a namespace + if backendPath := GetParam(secretConfig, api.EnvVaultNamespace); backendPath != "" { + client.SetNamespace(secretConfig[api.EnvVaultNamespace]) + } + // Configure the authentication method, either Token or Kubernetes. // Both return a token token, _, err := utils.Authenticate(client, c)