helm: Fix post job template (#16236)

This commit is contained in:
mruzicka 2022-12-18 17:01:22 +01:00 committed by GitHub
parent 3ae1f9d852
commit 6197ba851b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ metadata:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
{{- with .Values.postJob.annotations }}
{ { toYaml . | indent 4 } }
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
template:
@ -21,26 +21,26 @@ spec:
app: {{ template "minio.name" . }}-job
release: {{ .Release.Name }}
{{- if .Values.podLabels }}
{ { toYaml .Values.podLabels | indent 8 } }
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }}
{{- if .Values.postJob.podAnnotations }}
annotations:
{ { toYaml .Values.postJob.podAnnotations | indent 8 } }
{{- toYaml .Values.postJob.podAnnotations | nindent 8 }}
{{- end }}
spec:
restartPolicy: OnFailure
{ { - include "minio.imagePullSecrets" . | indent 6 } }
{{- include "minio.imagePullSecrets" . | nindent 6 }}
{{- if .Values.nodeSelector }}
nodeSelector:
{ { toYaml .Values.postJob.nodeSelector | indent 8 } }
{{- toYaml .Values.postJob.nodeSelector | nindent 8 }}
{{- end }}
{{- with .Values.postJob.affinity }}
affinity:
{ { toYaml . | indent 8 } }
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.postJob.tolerations }}
tolerations:
{ { toYaml . | indent 8 } }
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.postJob.securityContext.enabled }}
securityContext:
@ -59,10 +59,10 @@ volumes:
{{- range .Values.users }}
{{- if .existingSecret }}
- secret:
name: { { tpl .existingSecret $global } }
name: {{ tpl .existingSecret $ }}
items:
- key: {{ .existingSecretKey }}
path: secrets/{{ tpl .existingSecretKey $global }}
path: secrets/{{ tpl .existingSecretKey $ }}
{{- end }}
{{- end }}
{{- if .Values.tls.enabled }}
@ -75,7 +75,7 @@ volumes:
{{ end }}
containers:
{{- if .Values.buckets }}
- name: minio-makeBucket
- name: minio-make-bucket
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
{{- if .Values.makeBucketJob.securityContext.enabled }}
securityContext:
@ -86,7 +86,7 @@ containers:
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
{{- if .Values.makeBucketJob.exitCommand }}
command: [ "/bin/sh", "-c" ]
args: [ "/bin/sh /config/initialize; x=$(echo $?); {{ .Values.makeBucketJob.exitCommand }} && exit $x" ]
args: [ "/bin/sh /config/initialize; EV=$?; {{ .Values.makeBucketJob.exitCommand }} && exit $EV" ]
{{- else }}
command: [ "/bin/sh", "/config/initialize" ]
{{- end }}
@ -103,10 +103,10 @@ containers:
mountPath: {{ .Values.configPathmc }}certs
{{ end }}
resources:
{ { toYaml .Values.makeBucketJob.resources | indent 10 } }
{{- toYaml .Values.makeBucketJob.resources | nindent 12 }}
{{- end }}
{{- if .Values.users }}
- name: minio-makeUser
- name: minio-make-user
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
{{- if .Values.makeUserJob.securityContext.enabled }}
securityContext:
@ -117,7 +117,7 @@ containers:
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
{{- if .Values.makeUserJob.exitCommand }}
command: [ "/bin/sh", "-c" ]
args: [ "/bin/sh /config/add-user; x=$(echo $?); {{ .Values.makeUserJob.exitCommand }} && exit $x" ]
args: [ "/bin/sh /config/add-user; EV=$?; {{ .Values.makeUserJob.exitCommand }} && exit $EV" ]
{{- else }}
command: [ "/bin/sh", "/config/add-user" ]
{{- end }}
@ -134,10 +134,10 @@ containers:
mountPath: {{ .Values.configPathmc }}certs
{{ end }}
resources:
{ { toYaml .Values.makeUserJob.resources | indent 10 } }
{{- toYaml .Values.makeUserJob.resources | nindent 12 }}
{{- end }}
{{- if .Values.policies }}
- name: minio-makePolicy
- name: minio-make-policy
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
{{- if .Values.makePolicyJob.securityContext.enabled }}
securityContext:
@ -148,7 +148,7 @@ containers:
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
{{- if .Values.makePolicyJob.exitCommand }}
command: [ "/bin/sh", "-c" ]
args: [ "/bin/sh /config/add-policy; x=$(echo $?); {{ .Values.makePolicyJob.exitCommand }} && exit $x" ]
args: [ "/bin/sh /config/add-policy; EV=$?; {{ .Values.makePolicyJob.exitCommand }} && exit $EV" ]
{{- else }}
command: [ "/bin/sh", "/config/add-policy" ]
{{- end }}
@ -165,10 +165,10 @@ containers:
mountPath: {{ .Values.configPathmc }}certs
{{ end }}
resources:
{ { toYaml .Values.makePolicyJob.resources | indent 10 } }
{{- toYaml .Values.makePolicyJob.resources | nindent 12 }}
{{- end }}
{{- if .Values.customCommands }}
- name: minio-customCommand
- name: minio-custom-command
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
{{- if .Values.customCommandJob.securityContext.enabled }}
securityContext:
@ -179,7 +179,7 @@ containers:
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
{{- if .Values.customCommandJob.exitCommand }}
command: [ "/bin/sh", "-c" ]
args: [ "/bin/sh /config/custom-command; x=$(echo $?); {{ .Values.customCommandJob.exitCommand }} && exit $x" ]
args: [ "/bin/sh /config/custom-command; EV=$?; {{ .Values.customCommandJob.exitCommand }} && exit $EV" ]
{{- else }}
command: [ "/bin/sh", "/config/custom-command" ]
{{- end }}
@ -196,7 +196,7 @@ containers:
mountPath: {{ .Values.configPathmc }}certs
{{ end }}
resources:
{ { toYaml .Values.customCommandJob.resources | indent 10 } }
{{- toYaml .Values.customCommandJob.resources | nindent 12 }}
{{- end }}
{{- if .Values.svcaccts }}
- name: minio-make-svcacct
@ -210,7 +210,7 @@ containers:
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
{{- if .Values.makeServiceAccountJob.exitCommand }}
command: [ "/bin/sh", "-c" ]
args: ["/bin/sh /config/add-svcacct; x=$(echo $?); {{ .Values.makeServiceAccountJob.exitCommand }} && exit $x" ]
args: ["/bin/sh /config/add-svcacct; EV=$?; {{ .Values.makeServiceAccountJob.exitCommand }} && exit $EV" ]
{{- else }}
command: ["/bin/sh", "/config/add-svcacct"]
{{- end }}
@ -227,5 +227,5 @@ containers:
mountPath: {{ .Values.configPathmc }}certs
{{ end }}
resources:
{{ toYaml .Values.makeServiceAccountJob.resources | indent 10 }}
{{- toYaml .Values.makeServiceAccountJob.resources | nindent 12 }}
{{- end }}