forked from rook/rook
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user