mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
rbd: unmarshal the data read from file
if are reading the kms data from the file. than only we need to unmarshal. If we are reading from the configmap it already returns the unmarshal data. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
50a720f13d
commit
b370d9afb6
@ -145,11 +145,11 @@ func GetKMS(tenant, kmsID string, secrets map[string]string) (EncryptionKMS, err
|
||||
return nil, fmt.Errorf("failed to read kms configuration from configmap %s in namespace %s: %w",
|
||||
namespace, name, err)
|
||||
}
|
||||
}
|
||||
|
||||
err = json.Unmarshal(content, &config)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse kms configuration: %w", err)
|
||||
} else {
|
||||
err = json.Unmarshal(content, &config)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse kms configuration: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
kmsConfig, ok := config[kmsID].(map[string]interface{})
|
||||
|
Loading…
Reference in New Issue
Block a user