Skip to content

Commit

Permalink
Merge pull request #113 from adberger/master
Browse files Browse the repository at this point in the history
[common]: Add ability to set defaultMode for all configFiles
  • Loading branch information
adberger authored Aug 21, 2023
2 parents 21161bf + acd8da1 commit 5b11e56
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: common
description: "Bedag's common Helm chart to use for creating other Helm charts"
version: 10.5.0
version: 10.6.0
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand Down
2 changes: 1 addition & 1 deletion charts/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 10.5.0](https://img.shields.io/badge/Version-10.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 10.6.0](https://img.shields.io/badge/Version-10.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Bedag's common Helm chart to use for creating other Helm charts

Expand Down
6 changes: 6 additions & 0 deletions charts/common/templates/_pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,17 @@ volumes:
- name: {{ $containerName }}-configfiles
configMap:
name: {{ template "library.name" $root }}-{{ $name }}-{{ $containerName }}-configfiles
{{- if $containerValues.configFilesDefaultMode }}
defaultMode: {{ $containerValues.configFilesDefaultMode }}
{{- end }}
{{- end }}
{{- if $secretConfigs }}
- name: {{ $containerName }}-secret-configfiles
secret:
secretName: {{ template "library.name" $root }}-{{ $name }}-{{ $containerName }}-secret-configfiles
{{- if $containerValues.configFilesDefaultMode }}
defaultMode: {{ $containerValues.configFilesDefaultMode }}
{{- end }}
{{- end }}
{{- end }}
{{- $binaryFiles := $containerValues.binaryFiles }}
Expand Down
3 changes: 3 additions & 0 deletions charts/common/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
"envConfigMap": {
"type": "object"
},
"configFilesDefaultMode": {
"type": "integer"
},
"configFiles": {
"type": "object",
"patternProperties": {
Expand Down
5 changes: 5 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ components:
# envConfigMap is a dictionary of environment variables set for the current container, key: value
# envConfigMap: {}

# configFilesDefaultMode sets permissions for all configFiles mounted.
# See 'pod.spec.volumes.configMap.defaultMode' or 'pod.spec.volumes.secret.defaultMode' for more information
# Comment out for using default (0644)
# configFilesDefaultMode: 0644

# configFiles is a dictionary of arbitrary config files in the structure below
# format has to be "key=value", "yaml" or "simple". Default: "key=value"
# secret is optional for specifying if file should be created as a Secret (= true) or ConfigMap (= false or not specified)
Expand Down

0 comments on commit 5b11e56

Please sign in to comment.