Skip to content

Commit

Permalink
feat: add support for defaultMode specification (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
morremeyer authored Nov 13, 2024
1 parent 002235e commit 9d026d3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/cronjob/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion charts/cronjob/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 |
Expand Down
3 changes: 3 additions & 0 deletions charts/cronjob/ci/configmap-string-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ configMap:
enabled: true
data:
test: This is a string

mountPath: /data
defaultMode: "0555"
3 changes: 3 additions & 0 deletions charts/cronjob/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,8 @@ spec:
- name: configmap
configMap:
name: {{ include "cronjob.fullname" . }}
{{- with .Values.configMap.defaultMode }}
defaultMode: {{ . }}
{{- end }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/cronjob/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9d026d3

Please sign in to comment.