diff --git a/charts/library/common-test/tests/container/volumemounts_test.yaml b/charts/library/common-test/tests/container/volumemounts_test.yaml index 8be12326..111afdec 100644 --- a/charts/library/common-test/tests/container/volumemounts_test.yaml +++ b/charts/library/common-test/tests/container/volumemounts_test.yaml @@ -43,6 +43,8 @@ tests: data: type: configMap name: myConfigMap + globalMounts: + - path: /globalTest advancedMounts: main: main: @@ -60,6 +62,12 @@ tests: - documentIndex: *DeploymentDoc equal: path: spec.template.spec.containers[0].volumeMounts[0] + value: + name: data + mountPath: /globalTest + - documentIndex: *DeploymentDoc + equal: + path: spec.template.spec.containers[0].volumeMounts[1] value: name: data mountPath: /data/config.yaml @@ -67,6 +75,12 @@ tests: - documentIndex: *DeploymentDoc equal: path: spec.template.spec.containers[1].volumeMounts[0] + value: + name: data + mountPath: /globalTest + - documentIndex: *DeploymentDoc + equal: + path: spec.template.spec.containers[1].volumeMounts[1] value: name: data mountPath: /appdata/config diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index fd501f5f..b0d5409e 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 name: common description: Function library for Helm charts type: library -version: 2.0.0-beta.2 +version: 2.0.0-beta.3 kubeVersion: ">=1.22.0-0" keywords: - common @@ -15,11 +15,12 @@ maintainers: annotations: # TODO: Update this before releasing artifacthub.io/changes: |- - - kind: changed - description: Many things :P - kind: removed description: |- **BREAKING CHANGE** Removed support for add-ons. These can be configured through other means nowadays. + - kind: added + description: |- + **BREAKING CHANGE** Added support for managing multiple controllers / containers. This has introduced a number of breaking changes. Please see updated values.yaml - kind: added description: Added support for ordering (init)Containers within a controller. - kind: added diff --git a/charts/library/common/templates/lib/container/fields/_volumeMounts.tpl b/charts/library/common/templates/lib/container/fields/_volumeMounts.tpl index 44e70254..f728abde 100644 --- a/charts/library/common/templates/lib/container/fields/_volumeMounts.tpl +++ b/charts/library/common/templates/lib/container/fields/_volumeMounts.tpl @@ -32,8 +32,13 @@ volumeMounts used by the container. {{- $mounts := list -}} {{- if hasKey . "globalMounts" -}} {{- $mounts = .globalMounts -}} - {{- else if hasKey . "advancedMounts" -}} - {{- $mounts = dig $controllerObject.identifier $containerObject.identifier list .advancedMounts -}} + {{- end -}} + + {{- if hasKey . "advancedMounts" -}} + {{- $advancedMounts := dig $controllerObject.identifier $containerObject.identifier list .advancedMounts -}} + {{- range $advancedMounts -}} + {{- $mounts = append $mounts . -}} + {{- end -}} {{- end -}} {{- range $mounts -}}