util: use ConfigMap.Data instead of .BinaryData

When using .BinaryData, the contents of the configuration is not parsed
correctly. Whereas the parsing works fine whet .Data is used.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-03-29 13:47:40 +02:00 committed by mergify[bot]
parent 9e957520ae
commit d0f054bb6c

View File

@ -135,9 +135,9 @@ func getKMSConfigMap() (map[string]interface{}, error) {
// convert cm.Data from map[string]interface{}
kmsConfig := make(map[string]interface{})
for kmsID, data := range cm.BinaryData {
for kmsID, data := range cm.Data {
section := make(map[string]interface{})
err = json.Unmarshal(data, &section)
err = json.Unmarshal([]byte(data), &section)
if err != nil {
return nil, fmt.Errorf("could not convert contents "+
"of %q to s config section", kmsID)