mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
rbd: fix issue in ENV variable check
Currently cephcsi is returning an error if the ENV variable is set, but it should not. This commit fixes the the POD_NAMESPACE env variable issue and as well as the KMS_CONFIG_NAME ENV variable. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
0b7521162c
commit
584a43dc2c
@ -133,11 +133,11 @@ func GetKMS(tenant, kmsID string, secrets map[string]string) (EncryptionKMS, err
|
||||
// If the configmap is not mounted to the CSI pods read the configmap
|
||||
// the kubernetes.
|
||||
namespace := os.Getenv(podNamespace)
|
||||
if namespace != "" {
|
||||
if namespace == "" {
|
||||
return nil, fmt.Errorf("%q is not set", podNamespace)
|
||||
}
|
||||
name := os.Getenv(kmsConfigMapName)
|
||||
if name != "" {
|
||||
if name == "" {
|
||||
name = defaultConfigMapToRead
|
||||
}
|
||||
config, err = getVaultConfiguration(namespace, name)
|
||||
|
Loading…
Reference in New Issue
Block a user