Optionally run a command when completing jobs (#15017)

This commit is contained in:
Andrew Hibbert 2022-07-28 04:51:16 +01:00 committed by GitHub
parent aff236e20e
commit 0357121d17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 2 deletions

View File

@ -69,7 +69,12 @@ spec:
- name: minio-mc
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
{{- if .Values.makeBucketJob.exitCommand }}
command: ["/bin/sh", "-c"]
args: ["/bin/sh /config/initialize; x=$(echo $?); {{ .Values.makeBucketJob.exitCommand }} && exit $x" ]
{{- else }}
command: ["/bin/sh", "/config/initialize"]
{{- end }}
env:
- name: MINIO_ENDPOINT
value: {{ template "minio.fullname" . }}

View File

@ -69,7 +69,12 @@ spec:
- name: minio-mc
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
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" ]
{{- else }}
command: ["/bin/sh", "/config/add-policy"]
{{- end }}
env:
- name: MINIO_ENDPOINT
value: {{ template "minio.fullname" . }}

View File

@ -79,7 +79,12 @@ spec:
- name: minio-mc
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
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" ]
{{- else }}
command: ["/bin/sh", "/config/add-user"]
{{- end }}
env:
- name: MINIO_ENDPOINT
value: {{ template "minio.fullname" . }}

View File

@ -69,7 +69,12 @@ spec:
- name: minio-mc
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
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" ]
{{- else }}
command: ["/bin/sh", "/config/custom-command"]
{{- end }}
env:
- name: MINIO_ENDPOINT
value: {{ template "minio.fullname" . }}

View File

@ -310,6 +310,8 @@ makePolicyJob:
nodeSelector: {}
tolerations: []
affinity: {}
# Command to run after the main command on exit
exitCommand: ""
## List of users to be created after minio install
##
@ -344,6 +346,8 @@ makeUserJob:
nodeSelector: {}
tolerations: []
affinity: {}
# Command to run after the main command on exit
exitCommand: ""
## List of buckets to be created after minio install
##
@ -378,7 +382,9 @@ makeBucketJob:
nodeSelector: {}
tolerations: []
affinity: {}
# Command to run after the main command on exit
exitCommand: ""
## List of command to run after minio install
## NOTE: the mc command TARGET is always "myminio"
customCommands:
@ -399,7 +405,9 @@ customCommandJob:
nodeSelector: {}
tolerations: []
affinity: {}
# Command to run after the main command on exit
exitCommand: ""
## Use this field to add environment variables relevant to MinIO server. These fields will be passed on to MinIO container(s)
## when Chart is deployed
environment: