diff --git a/charts/datahub/subcharts/acryl-datahub-actions/templates/deployment.yaml b/charts/datahub/subcharts/acryl-datahub-actions/templates/deployment.yaml index fbef0919f..631d32b2a 100644 --- a/charts/datahub/subcharts/acryl-datahub-actions/templates/deployment.yaml +++ b/charts/datahub/subcharts/acryl-datahub-actions/templates/deployment.yaml @@ -64,7 +64,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: {{ include "datahub.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.image) }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http diff --git a/charts/datahub/subcharts/datahub-frontend/templates/deployment.yaml b/charts/datahub/subcharts/datahub-frontend/templates/deployment.yaml index d2a61d2b2..e90e4fa3a 100644 --- a/charts/datahub/subcharts/datahub-frontend/templates/deployment.yaml +++ b/charts/datahub/subcharts/datahub-frontend/templates/deployment.yaml @@ -66,7 +66,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: {{ include "datahub.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.image) }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.image.command }} command: {{ .Values.image.command | toRawJson }} diff --git a/charts/datahub/subcharts/datahub-gms/templates/deployment.yaml b/charts/datahub/subcharts/datahub-gms/templates/deployment.yaml index 5882a0846..d97d56d88 100644 --- a/charts/datahub/subcharts/datahub-gms/templates/deployment.yaml +++ b/charts/datahub/subcharts/datahub-gms/templates/deployment.yaml @@ -70,7 +70,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: {{ include "datahub.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.image) }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.image.command }} command: {{ .Values.image.command | toRawJson }} diff --git a/charts/datahub/subcharts/datahub-ingestion-cron/templates/cron.yaml b/charts/datahub/subcharts/datahub-ingestion-cron/templates/cron.yaml index d59ee07d5..1db3aea25 100644 --- a/charts/datahub/subcharts/datahub-ingestion-cron/templates/cron.yaml +++ b/charts/datahub/subcharts/datahub-ingestion-cron/templates/cron.yaml @@ -42,7 +42,7 @@ spec: {{- toYaml $.Values.podSecurityContext | nindent 12 }} containers: - name: {{ $jobName }}-crawler - image: {{ include "datahub.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.image) }} imagePullPolicy: {{ $.Values.image.pullPolicy }} volumeMounts: - name: recipe diff --git a/charts/datahub/subcharts/datahub-mae-consumer/templates/deployment.yaml b/charts/datahub/subcharts/datahub-mae-consumer/templates/deployment.yaml index 91d7c38b7..67803f9b7 100644 --- a/charts/datahub/subcharts/datahub-mae-consumer/templates/deployment.yaml +++ b/charts/datahub/subcharts/datahub-mae-consumer/templates/deployment.yaml @@ -61,7 +61,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: {{ include "datahub.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.image) }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.image.command }} command: {{ .Values.image.command | toRawJson }} diff --git a/charts/datahub/subcharts/datahub-mce-consumer/templates/deployment.yaml b/charts/datahub/subcharts/datahub-mce-consumer/templates/deployment.yaml index 6ecf4115a..b055fd897 100644 --- a/charts/datahub/subcharts/datahub-mce-consumer/templates/deployment.yaml +++ b/charts/datahub/subcharts/datahub-mce-consumer/templates/deployment.yaml @@ -65,7 +65,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: {{ include "datahub.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.image) }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.image.command }} command: {{ .Values.image.command | toRawJson }} diff --git a/charts/datahub/templates/_helpers.tpl b/charts/datahub/templates/_helpers.tpl index 04e535d24..7dc4c4e21 100644 --- a/charts/datahub/templates/_helpers.tpl +++ b/charts/datahub/templates/_helpers.tpl @@ -74,41 +74,9 @@ Return the appropriate apiVersion for cronjob. {{- end -}} {{/* -Create general image registry, name and tag +Create image registry, name and tag for a datahub component */}} {{- define "datahub.image" -}} -{{- $registry := .Values.global.imageRegistry | default .Values.image.registry -}} -{{ $registry }}/{{ .Values.image.repository }}:{{ required "Global or specific tag is required" (.Values.image.tag | default .Values.global.datahub.version) -}} -{{- end -}} - -{{/* -Create image registry, name and tag for elasticsearch setup job -*/}} -{{- define "elasticsearchSetupJob.image" -}} -{{- $registry := .Values.global.imageRegistry | default .Values.elasticsearchSetupJob.image.registry -}} -{{ $registry }}/{{ .Values.elasticsearchSetupJob.image.repository }}:{{ required "Global or specific tag is required" (.Values.elasticsearchSetupJob.image.tag | default .Values.global.datahub.version) -}} -{{- end -}} - -{{/* -Create image registry, name and tag for kafka setup job -*/}} -{{- define "kafkaSetupJob.image" -}} -{{- $registry := .Values.global.imageRegistry | default .Values.kafkaSetupJob.image.registry -}} -{{ $registry }}/{{ .Values.kafkaSetupJob.image.repository }}:{{ required "Global or specific tag is required" (.Values.kafkaSetupJob.image.tag | default .Values.global.datahub.version) -}} -{{- end -}} - -{{/* -Create image registry, name and tag for mysql setup job -*/}} -{{- define "mysqlSetupJob.image" -}} -{{- $registry := .Values.global.imageRegistry | default .Values.mysqlSetupJob.image.registry -}} -{{ $registry }}/{{ .Values.mysqlSetupJob.image.repository }}:{{ required "Global or specific tag is required" (.Values.mysqlSetupJob.image.tag | default .Values.global.datahub.version) -}} -{{- end -}} - -{{/* -Create image registry, name and tag for postgres setup job -*/}} -{{- define "postgresqlSetupJob.image" -}} -{{- $registry := .Values.global.imageRegistry | default .Values.postgresqlSetupJob.image.registry -}} -{{ $registry }}/{{ .Values.postgresqlSetupJob.image.repository }}:{{ required "Global or specific tag is required" (.Values.postgresqlSetupJob.image.tag | default .Values.global.datahub.version) -}} +{{- $registry := .imageRegistry | default .image.registry -}} +{{ $registry }}/{{ .image.repository }}:{{ required "Global or specific tag is required" (.image.tag | default .version) -}} {{- end -}} diff --git a/charts/datahub/templates/datahub-upgrade/_upgrade.tpl b/charts/datahub/templates/datahub-upgrade/_upgrade.tpl index 0d1056432..a4921c78f 100644 --- a/charts/datahub/templates/datahub-upgrade/_upgrade.tpl +++ b/charts/datahub/templates/datahub-upgrade/_upgrade.tpl @@ -144,19 +144,3 @@ Return the env variables for upgrade jobs value: {{ .datahub_upgrade_history_topic_name }} {{- end }} {{- end -}} - -{{/* -Create image registry, name and tag for datahub upgrade jobs -*/}} -{{- define "datahubUpgrade.image" -}} -{{- $registry := .Values.global.imageRegistry | default .Values.datahubUpgrade.image.registry -}} -{{ $registry }}/{{ .Values.datahubUpgrade.image.repository }}:{{ required "Global or specific tag is required" (.Values.datahubUpgrade.image.tag | default .Values.global.datahub.version) -}} -{{- end -}} - -{{/* -Create image registry, name and tag for datahub system update job -*/}} -{{- define "datahubSystemUpdate.image" -}} -{{- $registry := .Values.global.imageRegistry | default .Values.datahubSystemUpdate.image.registry -}} -{{ $registry }}/{{ .Values.datahubSystemUpdate.image.repository }}:{{ required "Global or specific tag is required" (.Values.datahubSystemUpdate.image.tag | default .Values.global.datahub.version) -}} -{{- end -}} diff --git a/charts/datahub/templates/datahub-upgrade/datahub-cleanup-job-template.yml b/charts/datahub/templates/datahub-upgrade/datahub-cleanup-job-template.yml index 3abae541d..5f5b95a25 100644 --- a/charts/datahub/templates/datahub-upgrade/datahub-cleanup-job-template.yml +++ b/charts/datahub/templates/datahub-upgrade/datahub-cleanup-job-template.yml @@ -54,7 +54,7 @@ spec: {{- end }} containers: - name: datahub-upgrade-job - image: {{ include "datahubUpgrade.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.datahubUpgrade.image) }} imagePullPolicy: {{ .Values.datahubUpgrade.image.pullPolicy | default "IfNotPresent" }} {{- if .Values.datahubUpgrade.cleanupJob.image.command }} command: {{ .Values.datahubUpgrade.cleanupJob.image.command | toRawJson }} diff --git a/charts/datahub/templates/datahub-upgrade/datahub-nocode-migration-job.yml b/charts/datahub/templates/datahub-upgrade/datahub-nocode-migration-job.yml index f3968976b..3ab4fd447 100644 --- a/charts/datahub/templates/datahub-upgrade/datahub-nocode-migration-job.yml +++ b/charts/datahub/templates/datahub-upgrade/datahub-nocode-migration-job.yml @@ -55,7 +55,7 @@ spec: {{- end }} containers: - name: datahub-upgrade-job - image: {{ include "datahubUpgrade.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.datahubUpgrade.image) }} imagePullPolicy: {{ .Values.datahubUpgrade.image.pullPolicy | default "IfNotPresent" }} {{- if .Values.datahubUpgrade.noCodeDataMigration.image.command }} command: {{ .Values.datahubUpgrade.noCodeDataMigration.image.command | toRawJson }} diff --git a/charts/datahub/templates/datahub-upgrade/datahub-restore-indices-job-template.yml b/charts/datahub/templates/datahub-upgrade/datahub-restore-indices-job-template.yml index 0350a25b0..9495b2899 100644 --- a/charts/datahub/templates/datahub-upgrade/datahub-restore-indices-job-template.yml +++ b/charts/datahub/templates/datahub-upgrade/datahub-restore-indices-job-template.yml @@ -60,7 +60,7 @@ spec: {{- end }} containers: - name: datahub-upgrade-job - image: {{ include "datahubUpgrade.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.datahubUpgrade.image) }} imagePullPolicy: {{ .Values.datahubUpgrade.image.pullPolicy | default "IfNotPresent" }} {{- if .Values.datahubUpgrade.restoreIndices.image.command }} command: {{ .Values.datahubUpgrade.restoreIndices.image.command | toRawJson }} diff --git a/charts/datahub/templates/datahub-upgrade/datahub-system-update-job.yml b/charts/datahub/templates/datahub-upgrade/datahub-system-update-job.yml index a44416efa..0d2e974e8 100644 --- a/charts/datahub/templates/datahub-upgrade/datahub-system-update-job.yml +++ b/charts/datahub/templates/datahub-upgrade/datahub-system-update-job.yml @@ -55,7 +55,7 @@ spec: {{- end }} containers: - name: datahub-system-update-job - image: {{ include "datahubSystemUpdate.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.datahubSystemUpdate.image) }} imagePullPolicy: {{ .Values.datahubSystemUpdate.image.pullPolicy | default "IfNotPresent" }} {{- if .Values.datahubSystemUpdate.image.command }} command: {{ .Values.datahubSystemUpdate.image.command | toRawJson }} @@ -222,7 +222,7 @@ spec: {{- end }} containers: - name: datahub-system-update-job - image: {{ include "datahubSystemUpdate.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.datahubSystemUpdate.image) }} imagePullPolicy: {{ .Values.datahubSystemUpdate.image.pullPolicy | default "IfNotPresent" }} {{- if .Values.datahubSystemUpdate.image.command }} command: {{ .Values.datahubSystemUpdate.image.command | toRawJson }} diff --git a/charts/datahub/templates/elasticsearch-setup-job.yml b/charts/datahub/templates/elasticsearch-setup-job.yml index ccc8d5b0d..ff9ced2f5 100644 --- a/charts/datahub/templates/elasticsearch-setup-job.yml +++ b/charts/datahub/templates/elasticsearch-setup-job.yml @@ -49,7 +49,7 @@ spec: {{- end }} containers: - name: elasticsearch-setup-job - image: {{ include "elasticsearchSetupJob.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.elasticsearchSetupJob.image) }} imagePullPolicy: {{ .Values.elasticsearchSetupJob.image.pullPolicy | default "IfNotPresent" }} {{- if .Values.elasticsearchSetupJob.image.command }} command: {{ .Values.elasticsearchSetupJob.image.command | toRawJson }} diff --git a/charts/datahub/templates/kafka-setup-job.yml b/charts/datahub/templates/kafka-setup-job.yml index 11cc19575..0d4f45f5d 100644 --- a/charts/datahub/templates/kafka-setup-job.yml +++ b/charts/datahub/templates/kafka-setup-job.yml @@ -55,7 +55,7 @@ spec: {{- end }} containers: - name: kafka-setup-job - image: {{ include "kafkaSetupJob.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.kafkaSetupJob.image) }} imagePullPolicy: {{ .Values.kafkaSetupJob.image.pullPolicy | default "IfNotPresent" }} {{- if .Values.kafkaSetupJob.image.command }} command: {{ .Values.kafkaSetupJob.image.command | toRawJson }} diff --git a/charts/datahub/templates/mysql-setup-job.yml b/charts/datahub/templates/mysql-setup-job.yml index 04cf4cc6f..715d9a427 100644 --- a/charts/datahub/templates/mysql-setup-job.yml +++ b/charts/datahub/templates/mysql-setup-job.yml @@ -49,7 +49,7 @@ spec: {{- end }} containers: - name: mysql-setup-job - image: {{ include "mysqlSetupJob.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.mysqlSetupJob.image) }} imagePullPolicy: {{ .Values.mysqlSetupJob.image.pullPolicy | default "IfNotPresent" }} {{- if .Values.mysqlSetupJob.image.command }} command: {{ .Values.mysqlSetupJob.image.command | toRawJson }} diff --git a/charts/datahub/templates/postgresql-setup-job.yml b/charts/datahub/templates/postgresql-setup-job.yml index 8ffa2022c..996b47b29 100644 --- a/charts/datahub/templates/postgresql-setup-job.yml +++ b/charts/datahub/templates/postgresql-setup-job.yml @@ -49,7 +49,7 @@ spec: {{- end }} containers: - name: postgresql-setup-job - image: {{ include "postgresqlSetupJob.image" . }} + image: {{ include "datahub.image" (dict "imageRegistry" .Values.global.imageRegistry "version" .Values.global.datahub.version "image" .Values.postgresqlSetupJob.image) }} imagePullPolicy: {{ .Values.postgresqlSetupJob.image.pullPolicy | default "Always" }} {{- if .Values.postgresqlSetupJob.image.command }} command: {{ .Values.postgresqlSetupJob.image.command | toRawJson }}