From d0b1f7de4d5528495c6678fa5af1cb599d53a742 Mon Sep 17 00:00:00 2001 From: mgroth Date: Tue, 24 Mar 2026 14:41:41 +0100 Subject: [PATCH 1/2] feat(cron-job): add annotations support to CronJob and pod template Add annotationsEnabled/annotations for CronJob resource metadata and podAnnotationsEnabled/podAnnotations for pod template metadata. Both support per-cronjob overrides with global fallback. Bump version to 2.9.2. Co-Authored-By: Claude Sonnet 4.6 --- charts/cron-job/Chart.yaml | 2 +- charts/cron-job/templates/cronjob.yaml | 14 ++++++++++++++ charts/cron-job/values.yaml | 18 +++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/charts/cron-job/Chart.yaml b/charts/cron-job/Chart.yaml index 8ce7e53..75e2ea9 100644 --- a/charts/cron-job/Chart.yaml +++ b/charts/cron-job/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: EcoVadis Helm chart for K8s Cron Job name: charts-cron-job type: application -version: 2.9.1 +version: 2.9.2 dependencies: - name: charts-core version: 2.4.2 diff --git a/charts/cron-job/templates/cronjob.yaml b/charts/cron-job/templates/cronjob.yaml index b3ec19b..921fe95 100644 --- a/charts/cron-job/templates/cronjob.yaml +++ b/charts/cron-job/templates/cronjob.yaml @@ -36,6 +36,12 @@ {{- $nodeSelector := $cronjob.nodeSelector | default $global.nodeSelector }} {{- $affinity := $cronjob.affinity | default $global.affinity }} {{- $tolerations := $cronjob.tolerations | default $global.tolerations }} + +{{- /* Annotations configuration */ -}} +{{- $annotationsEnabled := $cronjob.annotationsEnabled | default $global.annotationsEnabled }} +{{- $annotations := $cronjob.annotations | default $global.annotations }} +{{- $podAnnotationsEnabled := $cronjob.podAnnotationsEnabled | default $global.podAnnotationsEnabled }} +{{- $podAnnotations := $cronjob.podAnnotations | default $global.podAnnotations }} --- apiVersion: batch/v1 kind: CronJob @@ -43,6 +49,10 @@ metadata: name: {{ include "charts-cron-job.fullname" (dict "root" $ "cronjob" $cronjob "index" $index) }} labels: {{- include "charts-cron-job.labels" (dict "root" $ "cronjob" $cronjob) | nindent 4 }} + {{- if $annotationsEnabled }} + annotations: + {{- toYaml $annotations | nindent 4 }} + {{- end }} spec: schedule: "{{ $schedule }}" concurrencyPolicy: "{{ $concurrencyPolicy }}" @@ -61,6 +71,10 @@ spec: metadata: labels: {{- include "charts-cron-job.labels" (dict "root" $ "cronjob" $cronjob) | nindent 12 }} + {{- if $podAnnotationsEnabled }} + annotations: + {{- toYaml $podAnnotations | nindent 12 }} + {{- end }} spec: {{- if $imagePullSecret }} imagePullSecrets: diff --git a/charts/cron-job/values.yaml b/charts/cron-job/values.yaml index 418af74..846d632 100644 --- a/charts/cron-job/values.yaml +++ b/charts/cron-job/values.yaml @@ -6,7 +6,7 @@ # Define cronjobs array when you need multiple jobs with different configurations. #cronjobs: # - schedule: "" -# nameOverride: +# nameOverride: # fullnameOverride: # image: # name: # app name @@ -17,6 +17,12 @@ # additionalLabelsEnabled: true # additionalLabels: # team: #{team}# +# annotationsEnabled: true +# annotations: +# example.com/annotation: value +# podAnnotationsEnabled: true +# podAnnotations: +# example.com/pod-annotation: value global: schedule: "" @@ -62,6 +68,16 @@ global: additionalLabelsEnabled: false additionalLabels: {} + # Annotations added to the CronJob resource metadata + annotationsEnabled: false + annotations: {} + #example.com/annotation: value + + # Annotations added to the pod template metadata + podAnnotationsEnabled: false + podAnnotations: {} + #example.com/pod-annotation: value + securityContext: allowPrivilegeEscalation: false capabilities: From fbe7f4bd16bff51e9b98425871ff7fbe88922849 Mon Sep 17 00:00:00 2001 From: mgroth Date: Wed, 25 Mar 2026 06:56:08 +0100 Subject: [PATCH 2/2] update minor version --- charts/cron-job/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cron-job/Chart.yaml b/charts/cron-job/Chart.yaml index 75e2ea9..13369c1 100644 --- a/charts/cron-job/Chart.yaml +++ b/charts/cron-job/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: EcoVadis Helm chart for K8s Cron Job name: charts-cron-job type: application -version: 2.9.2 +version: 2.10.0 dependencies: - name: charts-core version: 2.4.2