diff --git a/pkg/backends/ibmsecretsmanager.go b/pkg/backends/ibmsecretsmanager.go index 55a29ccb..8860032b 100644 --- a/pkg/backends/ibmsecretsmanager.go +++ b/pkg/backends/ibmsecretsmanager.go @@ -1,7 +1,7 @@ package backends import ( - "encoding/json" + // "encoding/json" "fmt" "regexp" "sync" @@ -63,10 +63,7 @@ func (i *IBMSecretsManager) getSecretVersionedOrNot(secret *ibmsm.SecretResource return nil, fmt.Errorf("Could not retrieve secret %s after %d retries, statuscode %d", *secret.ID, types.IBMMaxRetries, httpResponse.GetStatusCode()) } - // Versioned certificate secret_data comes back in a special struct and we want a map - certData := (secretVersion.Resources[0].(*ibmsm.SecretVersion)).SecretData - certJson, _ := json.Marshal(&certData) - _ = json.Unmarshal(certJson, &result) + result = (secretVersion.Resources[0].(*ibmsm.SecretVersion)).SecretData.(map[string]interface{}) } else { secretRes, httpResponse, err := i.Client.GetSecret(&ibmsm.GetSecretOptions{ SecretType: secret.SecretType, diff --git a/pkg/backends/ibmsecretsmanager_test.go b/pkg/backends/ibmsecretsmanager_test.go index 58abb992..d22a73dd 100644 --- a/pkg/backends/ibmsecretsmanager_test.go +++ b/pkg/backends/ibmsecretsmanager_test.go @@ -150,8 +150,8 @@ func (m *MockIBMSMClient) GetSecretVersion(getSecretOptions *ibmsm.GetSecretVers Resources: []ibmsm.SecretVersionIntf{ &ibmsm.SecretVersion{ ID: &id, - SecretData: &ibmsm.CertificateSecretData{ - Certificate: &data, + SecretData: map[string]interface{}{ + "certificate": data, }, }, },