From e6ac98575f400fe7dd5195b42991b34d7c736193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9?= Date: Tue, 2 Apr 2024 10:50:18 +0200 Subject: [PATCH] Support non-base64 encoded secret (#97) --- internal/helm/registry/auth.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/helm/registry/auth.go b/internal/helm/registry/auth.go index e1cccc6..ca83bab 100644 --- a/internal/helm/registry/auth.go +++ b/internal/helm/registry/auth.go @@ -74,7 +74,17 @@ func LoginOptionFromSecret(registryURL string, secret corev1.Secret) (authn.Keyc username = authConfig.Username password = authConfig.Password } else { - username, password = string(secret.Data["username"]), string(secret.Data["password"]) + if val, ok := secret.StringData["username"]; ok { + username = val + } else { + username = string(secret.Data["username"]) + } + + if val, ok := secret.StringData["password"]; ok { + password = val + } else { + password = string(secret.Data["password"]) + } } switch { case username == "" && password == "":