Commit ae388fd8 authored by Jiaqi Luo's avatar Jiaqi Luo
Browse files

Add a template function to better handle the system default registry in post-delete-hook-job

parent 71e607dc
Showing with 11 additions and 1 deletion
+11 -1
...@@ -33,3 +33,13 @@ chart: {{ .Chart.Name }}-{{ .Chart.Version }} ...@@ -33,3 +33,13 @@ chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
release: {{ .Release.Name }} release: {{ .Release.Name }}
{{- end }} {{- end }}
{{- define "system_default_registry" -}}
{{- if .Values.systemDefaultRegistry -}}
{{- if hasSuffix "/" .Values.systemDefaultRegistry -}}
{{- printf "%s" .Values.systemDefaultRegistry -}}
{{- else -}}
{{- printf "%s/" .Values.systemDefaultRegistry -}}
{{- end -}}
{{- end -}}
{{- end -}}
...@@ -20,7 +20,7 @@ spec: ...@@ -20,7 +20,7 @@ spec:
restartPolicy: OnFailure restartPolicy: OnFailure
containers: containers:
- name: {{ template "rancher.name" . }}-post-delete - name: {{ template "rancher.name" . }}-post-delete
image: "{{ .Values.systemDefaultRegistry }}{{ .Values.postDelete.image.repository }}:{{ .Values.postDelete.image.tag }}" image: "{{ include "system_default_registry" . }}{{ .Values.postDelete.image.repository }}:{{ .Values.postDelete.image.tag }}"
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
runAsUser: 0 runAsUser: 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment