--- charts-original/templates/_helpers.tpl +++ charts/templates/_helpers.tpl @@ -54,11 +54,11 @@ {{/* Get specific image */}} -{{- define "ingress-nginx.image" -}} +{{- define "ingress-nginx.repository" -}} {{- if .chroot -}} -{{- printf "%s-chroot" .image -}} +{{- printf "%s-chroot" .repository -}} {{- else -}} -{{- printf "%s" .image -}} +{{- printf "%s" .repository -}} {{- end }} {{- end -}} @@ -169,7 +169,7 @@ Check the ingress controller version tag is at most three versions behind the last release */}} {{- define "isControllerTagValid" -}} -{{- if not (semverCompare ">=0.27.0-0" .Values.controller.image.tag) -}} +{{- if not (semverCompare ">=0.27.0-0" (trimPrefix "nginx-" .Values.controller.image.tag)) -}} {{- fail "Controller container image tag should be 0.27.0 or higher" -}} {{- end -}} {{- end -}} @@ -183,3 +183,15 @@ {{ toYaml .Values.controller.ingressClassResource.parameters | indent 4}} {{ end }} {{- end -}} + +{{- define "system_default_registry" -}} +{{- if .Values.global.systemDefaultRegistry -}} +{{- printf "%s/" .Values.global.systemDefaultRegistry -}} +{{- else -}} +{{- "" -}} +{{- end -}} +{{- end -}} + +{{- define "repository_or_registry_and_image" -}} +{{- if .repository -}}{{ .repository }}{{ else }}{{ .registry }}/{{ .image }}{{- end -}}:{{ .tag }}{{- if (.digest) -}} @{{.digest}} {{- end -}} +{{- end -}}