Skip to content

Commit

Permalink
Add pod annotations to jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
novotl committed Jun 28, 2022
1 parent 21d4f78 commit 0049623
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ spec:
jobTemplate:
spec:
template:
{{- if .Values.global.podLabels }}
{{- if or .Values.global.podLabels .Values.datahubUpgrade.podAnnotations }}
metadata:
{{- with .Values.datahubUpgrade.podAnnotations }}
annotations:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.global.podLabels }}
labels:
{{- range $key, $value := .Values.global.podLabels }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- with .Values.global.hostAliases }}
hostAliases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ spec:
jobTemplate:
spec:
template:
{{- if .Values.global.podLabels }}
{{- if or .Values.global.podLabels .Values.datahubUpgrade.podAnnotations }}
metadata:
{{- with .Values.datahubUpgrade.podAnnotations }}
annotations:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.global.podLabels }}
labels:
{{- range $key, $value := .Values.global.podLabels }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- with .Values.global.hostAliases }}
hostAliases:
Expand Down
10 changes: 8 additions & 2 deletions charts/datahub/templates/datahub-upgrade/datahub-upgrade-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation
spec:
template:
{{- if .Values.global.podLabels }}
{{- if or .Values.global.podLabels .Values.datahubUpgrade.podAnnotations}}
metadata:
{{- with .Values.datahubUpgrade.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.podLabels }}
labels:
{{- range $key, $value := .Values.global.podLabels }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- with .Values.global.hostAliases }}
hostAliases:
Expand Down
10 changes: 8 additions & 2 deletions charts/datahub/templates/elasticsearch-setup-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation
spec:
template:
{{- if .Values.global.podLabels }}
{{- if or .Values.global.podLabels .Values.elasticsearchSetupJob.podAnnotations }}
metadata:
{{- with .Values.elasticsearchSetupJob.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.podLabels }}
labels:
{{- range $key, $value := .Values.global.podLabels }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- with .Values.global.hostAliases }}
hostAliases:
Expand Down
10 changes: 8 additions & 2 deletions charts/datahub/templates/kafka-setup-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation
spec:
template:
{{- if .Values.global.podLabels }}
{{- if or .Values.global.podLabels .Values.kafkaSetupJob.podAnnotations }}
metadata:
{{- with .Values.kafkaSetupJob.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.podLabels }}
labels:
{{- range $key, $value := .Values.global.podLabels }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- with .Values.global.hostAliases }}
hostAliases:
Expand Down
10 changes: 8 additions & 2 deletions charts/datahub/templates/mysql-setup-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation
spec:
template:
{{- if .Values.global.podLabels }}
{{- if or .Values.global.podLabels .Values.mysqlSetupJob.podAnnotations }}
metadata:
{{- with .Values.mysqlSetupJob.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.podLabels }}
labels:
{{- range $key, $value := .Values.global.podLabels }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- with .Values.global.hostAliases }}
hostAliases:
Expand Down
10 changes: 8 additions & 2 deletions charts/datahub/templates/postgresql-setup-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation
spec:
template:
{{- if .Values.global.podLabels }}
{{- if or .Values.global.podLabels .Values.postgresqlSetupJob.podAnnotations }}
metadata:
{{- with .Values.postgresqlSetupJob.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.podLabels }}
labels:
{{- range $key, $value := .Values.global.podLabels }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- with .Values.global.hostAliases }}
hostAliases:
Expand Down

0 comments on commit 0049623

Please sign in to comment.