diff --git a/charts/portworx/templates/_helpers.tpl b/charts/portworx/templates/_helpers.tpl index 42556185..e3e7968c 100644 --- a/charts/portworx/templates/_helpers.tpl +++ b/charts/portworx/templates/_helpers.tpl @@ -69,14 +69,23 @@ release: {{ .Release.Name | quote }} {{- end -}} {{- define "px.getk8sImages" -}} +{{- $version := .Capabilities.KubeVersion.GitVersion -}} {{- if (.Values.customRegistryURL) -}} {{- if (eq "/" (.Values.customRegistryURL | regexFind "/")) -}} {{ trim .Values.customRegistryURL }} {{- else -}} - {{cat (trim .Values.customRegistryURL) "/gcr.io/google_containers" | replace " " ""}} + {{- if or (or (semverCompare ">= 1.16.14 <=1.17.0" $version ) (semverCompare ">= 1.17.10 <=1.18.0" $version )) (semverCompare ">=1.18.7" $version) -}} + {{cat (trim .Values.customRegistryURL) "/k8s.gcr.io" | replace " " ""}} + {{- else -}} + {{cat (trim .Values.customRegistryURL) "/gcr.io/google_containers" | replace " " ""}} + {{- end -}} {{- end -}} {{- else -}} + {{- if or (or (semverCompare ">= 1.16.14 <=1.17.0" $version ) (semverCompare ">= 1.17.10 <=1.18.0" $version )) (semverCompare ">=1.18.7" $version) -}} + {{ "k8s.gcr.io" }} + {{- else -}} {{ "gcr.io/google_containers" }} + {{- end -}} {{- end -}} {{- end -}}