From d0f054bb6ceecf36a23073a4eb35274fa5bef36c Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 29 Mar 2021 13:47:40 +0200 Subject: [PATCH] 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 --- internal/util/kms.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/util/kms.go b/internal/util/kms.go index 174b1f291..07a153070 100644 --- a/internal/util/kms.go +++ b/internal/util/kms.go @@ -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, §ion) + err = json.Unmarshal([]byte(data), §ion) if err != nil { return nil, fmt.Errorf("could not convert contents "+ "of %q to s config section", kmsID)