osd: add namespace in vault client

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 <seb@redhat.com>
This commit is contained in:
Sébastien Han
2022-02-10 12:13:41 +01:00
parent 014eef7bb9
commit 23832c8cc7
+5
View File
@@ -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)