Skip to content

Commit

Permalink
Support non-base64 encoded secret (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
dud225 committed Apr 2, 2024
1 parent 2e0a2cf commit e6ac985
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/helm/registry/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "":
Expand Down

0 comments on commit e6ac985

Please sign in to comment.