diff options
author | Jack Lucas <jflos@sonoris.net> | 2022-04-06 15:19:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-04-06 15:19:59 +0000 |
commit | db31b8313e56aea6907191fba45b6a82504707c0 (patch) | |
tree | 3c234b890f8c8cf3f3887e7e73579ad8ed870bf5 | |
parent | b7a43e236f17b83c2245da0b9c4d584eaae05d83 (diff) | |
parent | a64b1b58109d6b36deb961e27ded829e478cb74e (diff) |
Merge "[GLOBAL] Allow anonymous access to main repo"
-rw-r--r-- | kubernetes/common/repositoryGenerator/templates/_repository.tpl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kubernetes/common/repositoryGenerator/templates/_repository.tpl b/kubernetes/common/repositoryGenerator/templates/_repository.tpl index f57d390477..1b99285a80 100644 --- a/kubernetes/common/repositoryGenerator/templates/_repository.tpl +++ b/kubernetes/common/repositoryGenerator/templates/_repository.tpl @@ -154,6 +154,7 @@ mail: email (optional) You can also set the same things for dockerHub, elastic and googleK8s if needed. + if not needed, set global.repositoryCred.user to empty value. */}} {{- define "repositoryGenerator.secret" -}} {{- $dot := default . .dot -}} @@ -164,9 +165,11 @@ {{- if $subchartDot.Values.global.repositoryCred }} {{- $repo := $subchartDot.Values.global.repository }} {{- $cred := $subchartDot.Values.global.repositoryCred }} - {{- $mail := default "@" $cred.mail }} - {{- $auth := printf "%s:%s" $cred.user $cred.password | b64enc }} - {{- $repoCreds = printf "\"%s\": {\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}" $repo $cred.user $cred.password $mail $auth }} + {{- if $cred.user }} + {{- $mail := default "@" $cred.mail }} + {{- $auth := printf "%s:%s" $cred.user $cred.password | b64enc }} + {{- $repoCreds = printf "\"%s\": {\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}" $repo $cred.user $cred.password $mail $auth }} + {{- end }} {{- end }} {{- if $subchartDot.Values.global.dockerHubRepositoryCred }} {{- $dhRepo := $subchartDot.Values.global.dockerHubRepository }} |