X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2FrepositoryGenerator%2Ftemplates%2F_repository.tpl;h=1da838a5b95411b254238d1c0731b5e1ba917840;hb=refs%2Fheads%2Fmaster;hp=a6b434f43a28c431e511dc3c77b3cb795692f6e2;hpb=3465ee1be5636b48753bc7bf4d0bf8ca1fac5147;p=oom.git diff --git a/kubernetes/common/repositoryGenerator/templates/_repository.tpl b/kubernetes/common/repositoryGenerator/templates/_repository.tpl index a6b434f43a..1da838a5b9 100644 --- a/kubernetes/common/repositoryGenerator/templates/_repository.tpl +++ b/kubernetes/common/repositoryGenerator/templates/_repository.tpl @@ -1,5 +1,7 @@ {{/* # Copyright © 2017 Amdocs, Bell Canada +# Copyright © 2021 AT&T +# Modifications Copyright (C) 2021 Nordix Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -56,6 +58,16 @@ {{- include "repositoryGenerator._repositoryHelper" (merge (dict "repoName" "elasticRepository") .) }} {{- end -}} +{{/* + Resolve the name of the quay.io Repository image repository. + + - .Values.global.quayRepository : default image quayRepository for all images using quay repository + - .Values.quayRepositoryOverride : override global quayRepository repository on a per chart basis +*/}} +{{- define "repositoryGenerator.quayRepository" -}} + {{- include "repositoryGenerator._repositoryHelper" (merge (dict "repoName" "quayRepository") .) }} +{{- end -}} + {{/* Resolve the name of the googleK8sRepository image repository. @@ -66,6 +78,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 -}} @@ -82,8 +103,8 @@ {{- include "repositoryGenerator.image._helper" (merge (dict "image" "curlImage") .) }} {{- end -}} -{{- define "repositoryGenerator.image.certserviceclient" -}} - {{- include "repositoryGenerator.image._helper" (merge (dict "image" "certServiceClientImage") .) }} +{{- define "repositoryGenerator.image.dcaepolicysync" -}} + {{- include "repositoryGenerator.image._helper" (merge (dict "image" "dcaePolicySyncImage") .) }} {{- end -}} {{- define "repositoryGenerator.image.envsubst" -}} @@ -94,6 +115,10 @@ {{- include "repositoryGenerator.image._helper" (merge (dict "image" "htpasswdImage") .) }} {{- end -}} +{{- define "repositoryGenerator.image.jetty" -}} + {{- include "repositoryGenerator.image._helper" (merge (dict "image" "jettyImage") .) }} +{{- end -}} + {{- define "repositoryGenerator.image.jre" -}} {{- include "repositoryGenerator.image._helper" (merge (dict "image" "jreImage") .) }} {{- end -}} @@ -122,6 +147,14 @@ {{- include "repositoryGenerator.image._helper" (merge (dict "image" "readinessImage") .) }} {{- end -}} +{{- define "repositoryGenerator.image.drProvClient" -}} + {{- include "repositoryGenerator.image._helper" (merge (dict "image" "drProvClientImage") .) }} +{{- end -}} + +{{- define "repositoryGenerator.image.quitQuit" -}} + {{- include "repositoryGenerator.image._helper" (merge (dict "image" "quitQuitImage") .) }} +{{- end -}} + {{/* Resolve the image repository secret token. The value for .Values.global.repositoryCred is used if provided: @@ -131,6 +164,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 -}} @@ -138,12 +172,14 @@ {{/* Our version of helm doesn't support deepCopy so we need this nasty trick */}} {{- $subchartDot := fromJson (include "common.subChartDot" (dict "dot" $dot "initRoot" $initRoot)) }} {{- $repoCreds := "" }} - {{- if $subchartDot.Values.global.dockerHubRepositoryCred }} + {{- 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 }} @@ -181,5 +217,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 -}}