Skip to content

Commit

Permalink
Merge pull request #147 from bedag/feat/common-enable-mounting-of-exi…
Browse files Browse the repository at this point in the history
…sting-cm

[common]: Enable mounting of existing cm
  • Loading branch information
wthhub authored Jan 6, 2025
2 parents 68c1c42 + b58864c commit edfcf47
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 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: 12.1.0
version: 12.2.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: 12.1.0](https://img.shields.io/badge/Version-12.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 12.2.0](https://img.shields.io/badge/Version-12.2.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
9 changes: 9 additions & 0 deletions charts/common/templates/_pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,19 @@ volumes:
{{- end }}
{{- else if eq .type "configMap" }}
configMap:
{{- if .items }}
name: {{ .name }}
items:
{{- range .items }}
- key: {{ .key }}
path: {{ .path }}
{{- end }}
{{- else }}
name: {{ template "library.name" $root }}-{{ .name }}
{{- if .defaultMode }}
defaultMode: {{ .defaultMode }}
{{- end }}
{{- end }}
{{- else if eq .type "persistentVolumeClaim" }}
persistentVolumeClaim:
claimName: {{ template "library.name" $root }}-{{ .claimNameSuffix }}
Expand Down
19 changes: 19 additions & 0 deletions charts/common/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,25 @@
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"items": {
"type": "array",
"properties": {
"key": {
"type": "string"
},
"path": {
"type": "string"
}
}
}
},
"required": [
"name",
"type"
Expand Down
7 changes: 6 additions & 1 deletion charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,14 @@ components:
# volumes is a list of volumes to be created as secret or configMap
volumes: []
# -- name of the volume
# - name: generic-name
# - name: generic-name or existing-cm-name
# -- type can either be "secret", "configMap", "persistentVolumeClaim", "emptyDir", "external" or "csi"
# type: "secret"
# START ONLY FOR CONFIGMAP
# items:
# - key: foo.txt
# path: opt/foo.txt
# END ONLY FOR CONFIGMAP
# START ONLY FOR SECRET or CONFIGMAP
# filePath is optional for specifying a filePath in the helm chart where the file is located.
# filePath: "files/xy.yml"
Expand Down

0 comments on commit edfcf47

Please sign in to comment.