summaryrefslogtreecommitdiffstats
path: root/kubernetes/common/repositoryGenerator/templates
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-06-23 14:18:48 +0000
committerGerrit Code Review <gerrit@onap.org>2021-06-23 14:18:48 +0000
commit07efa9bb787a6a04dfb9771a3940b3461d247d20 (patch)
tree391591916ea45858d21bd78c6dd55f1d0447ea3d /kubernetes/common/repositoryGenerator/templates
parentfe651c1283fbdd67bd4482727f5b7298d55df9d8 (diff)
parent8c46517152352be675a79865edec27f9959602b6 (diff)
Merge "[OOM][DCAE] Chartmuseum deployment support"
Diffstat (limited to 'kubernetes/common/repositoryGenerator/templates')
-rw-r--r--kubernetes/common/repositoryGenerator/templates/_repository.tpl21
1 files changed, 21 insertions, 0 deletions
diff --git a/kubernetes/common/repositoryGenerator/templates/_repository.tpl b/kubernetes/common/repositoryGenerator/templates/_repository.tpl
index 488db054a0..211cf1c599 100644
--- a/kubernetes/common/repositoryGenerator/templates/_repository.tpl
+++ b/kubernetes/common/repositoryGenerator/templates/_repository.tpl
@@ -67,6 +67,15 @@
{{- include "repositoryGenerator._repositoryHelper" (merge (dict "repoName" "googleK8sRepository") .) }}
{{- end -}}
+{{/*
+ Resolve the name of the GithubContainer registry
+ - .Values.global.githubContainerRegistry : default image githubContainerRegistry for all dockerHub images
+ - .Values.githubContainerRegistryOverride : override global githubContainerRegistry on a per chart basis
+*/}}
+{{- define "repositoryGenerator.githubContainerRegistry" -}}
+ {{- include "repositoryGenerator._repositoryHelper" (merge (dict "repoName" "githubContainerRegistry") .) }}
+{{- end -}}
+
{{- define "repositoryGenerator.image._helper" -}}
{{- $dot := default . .dot -}}
{{- $initRoot := default $dot.Values.repositoryGenerator .initRoot -}}
@@ -182,5 +191,17 @@
{{- $repoCreds = printf "%s, %s" $repoCreds $gcrRepoCreds }}
{{- end }}
{{- end }}
+ {{- if $subchartDot.Values.global.githubContainerRegistryCred }}
+ {{- $ghcrRepo := $subchartDot.Values.global.githubContainerRegistry }}
+ {{- $ghcrCred := $subchartDot.Values.global.githubContainerRegistryCred }}
+ {{- $ghcrMail := default "@" $ghcrCred.mail }}
+ {{- $ghcrAuth := printf "%s:%s" $ghcrCred.user $ghcrCred.password | b64enc }}
+ {{- $ghcrRepoCreds := printf "\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}" $ghcrRepo $ghcrCred.user $ghcrCred.password $ghcrMail $ghcrAuth }}
+ {{- if eq "" $repoCreds }}
+ {{- $repoCreds = $ghcrRepoCreds }}
+ {{- else }}
+ {{- $repoCreds = printf "%s, %s" $repoCreds $ghcrRepoCreds }}
+ {{- end }}
+ {{- end }}
{{- printf "{%s}" $repoCreds | b64enc -}}
{{- end -}}