From cdee67d69102d01dc2a54918ac77e8a32ec9cc89 Mon Sep 17 00:00:00 2001 From: Timo Hankamer Date: Wed, 18 Nov 2026 07:50:59 +0100 Subject: [PATCH] Add option to set extra annotations on db-migrator job (chart) Signed-off-by: Timo Hankamer --- charts/artifact-hub/Chart.yaml | 2 +- charts/artifact-hub/templates/db_migrator_job.yaml | 7 +++++++ charts/artifact-hub/values.schema.json | 6 ++++++ charts/artifact-hub/values.yaml | 2 ++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/charts/artifact-hub/Chart.yaml b/charts/artifact-hub/Chart.yaml index e7b288cf8..35a5ce297 100644 --- a/charts/artifact-hub/Chart.yaml +++ b/charts/artifact-hub/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: artifact-hub description: Artifact Hub is a web-based application that enables finding, installing, and publishing Cloud Native packages. type: application -version: 1.24.0 +version: 1.24.1-0 appVersion: 1.24.0 kubeVersion: ">= 1.19.0-0" home: https://artifacthub.io diff --git a/charts/artifact-hub/templates/db_migrator_job.yaml b/charts/artifact-hub/templates/db_migrator_job.yaml index ed34112fb..a7441fca3 100644 --- a/charts/artifact-hub/templates/db_migrator_job.yaml +++ b/charts/artifact-hub/templates/db_migrator_job.yaml @@ -3,12 +3,19 @@ kind: Job metadata: {{- if .Release.IsInstall }} name: {{ include "chart.resourceNamePrefix" . }}db-migrator-install +{{- with .Values.dbMigrator.job.extraJobAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} {{- else }} name: {{ include "chart.resourceNamePrefix" . }}db-migrator-upgrade annotations: "helm.sh/hook": pre-upgrade "helm.sh/hook-weight": "0" "helm.sh/hook-delete-policy": before-hook-creation +{{- with .Values.dbMigrator.job.extraJobAnnotations }} + {{- toYaml . | nindent 4 }} +{{- end }} {{- end }} labels: {{- include "chart.labels" . | nindent 4 }} diff --git a/charts/artifact-hub/values.schema.json b/charts/artifact-hub/values.schema.json index b3253618a..28984c304 100644 --- a/charts/artifact-hub/values.schema.json +++ b/charts/artifact-hub/values.schema.json @@ -82,6 +82,12 @@ "type": "object", "default": {} }, + "extraJobAnnotations": { + "title": "Additional annotations for the DB migrator job", + "description": "Optionally specify extra list of additional annotations for the dbMigrator job", + "type": "object", + "default": {} + }, "extraPodLabels": { "title": "Additional labels for the DB migrator pod", "description": "Optionally specify extra list of additional labels for the dbMigrator pod", diff --git a/charts/artifact-hub/values.yaml b/charts/artifact-hub/values.yaml index 9d47ad165..ad8d2286f 100644 --- a/charts/artifact-hub/values.yaml +++ b/charts/artifact-hub/values.yaml @@ -94,6 +94,8 @@ dbMigrator: repository: artifacthub/db-migrator # Optionally specify extra list of additional labels for the dbMigrator job extraJobLabels: {} + # Optionally specify extra list of additional annotations for the dbMigrator job + extraJobAnnotations: {} # Optionally specify extra list of additional labels for the dbMigrator pod extraPodLabels: {} # Limits the lifetime of the job after it has finished execution