From 9d026d3d18bf8ab938d9ae0a939174f99cec15e2 Mon Sep 17 00:00:00 2001 From: morre Date: Wed, 13 Nov 2024 16:55:32 +0100 Subject: [PATCH] feat: add support for defaultMode specification (#377) --- charts/cronjob/Chart.yaml | 2 +- charts/cronjob/README.md | 3 ++- charts/cronjob/ci/configmap-string-values.yaml | 3 +++ charts/cronjob/templates/cronjob.yaml | 3 +++ charts/cronjob/values.yaml | 3 +++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/charts/cronjob/Chart.yaml b/charts/cronjob/Chart.yaml index e83c874b..b9513d99 100644 --- a/charts/cronjob/Chart.yaml +++ b/charts/cronjob/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: cronjob description: Run jobs on a schedule type: application -version: 3.8.0 +version: 3.9.0 maintainers: - name: morremeyer - name: ekeih diff --git a/charts/cronjob/README.md b/charts/cronjob/README.md index ea6dbcd8..48cd4bdf 100644 --- a/charts/cronjob/README.md +++ b/charts/cronjob/README.md @@ -1,6 +1,6 @@ # cronjob -![Version: 3.8.0](https://img.shields.io/badge/Version-3.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 3.9.0](https://img.shields.io/badge/Version-3.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Run jobs on a schedule @@ -81,6 +81,7 @@ configMap: | command | list | `[]` | the command or binary to run | | concurrencyPolicy | string | `"Allow"` | The [concurrencyPolicy](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#concurrency-policy) for the CronJob | | configMap.data | object | `{}` | The data for the ConfigMap. Both keys and values need to be strings. | +| configMap.defaultMode | string | `nil` | Set the `defaultMode` for the files in the directory. | | configMap.enabled | bool | `false` | If a ConfigMap with configurable values should be created | | configMap.mountFiles | list | `[]` | Mounting of individual keys in the ConfigMap as files | | configMap.mountPath | string | `""` | If specified, the ConfigMap is mounted as a directory at this path | diff --git a/charts/cronjob/ci/configmap-string-values.yaml b/charts/cronjob/ci/configmap-string-values.yaml index 171a4bf3..ec6a27a7 100644 --- a/charts/cronjob/ci/configmap-string-values.yaml +++ b/charts/cronjob/ci/configmap-string-values.yaml @@ -2,3 +2,6 @@ configMap: enabled: true data: test: This is a string + + mountPath: /data + defaultMode: "0555" diff --git a/charts/cronjob/templates/cronjob.yaml b/charts/cronjob/templates/cronjob.yaml index 41ab3021..1bdbda61 100644 --- a/charts/cronjob/templates/cronjob.yaml +++ b/charts/cronjob/templates/cronjob.yaml @@ -118,5 +118,8 @@ spec: - name: configmap configMap: name: {{ include "cronjob.fullname" . }} + {{- with .Values.configMap.defaultMode }} + defaultMode: {{ . }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/cronjob/values.yaml b/charts/cronjob/values.yaml index afc947fe..48c6b719 100644 --- a/charts/cronjob/values.yaml +++ b/charts/cronjob/values.yaml @@ -79,6 +79,9 @@ configMap: # -- If specified, the ConfigMap is mounted as a directory at this path mountPath: "" + # -- Set the `defaultMode` for the files in the directory. + defaultMode: null + # -- Mounting of individual keys in the ConfigMap as files mountFiles: [] # - subPath: "config.yml"