Closed jthvai closed 9 months ago
Thanks for reporting this issue! You are correct that persistence.advancedMounts
was meant to apply to initContainers as well. Unfortunately I forgot to pass through an object to the function, which makes it fail with the error you are seeing.
I have the fix working locally, but also need to fix volumeClaimTemplates
(which has a related bug) before I can release the fix
Details
What steps did you take and what happened:
When both
persistence.advancedMounts
andcontrollers.*.initContainers
are specified invalues.yaml
, installing or upgrading the chart (app-template) will fail with "error calling dig: interface conversion: interface {} is nil, not string".Failed example
`helm upgrade -i release-name bjw-s/app-template --version 2.0.0 -f values.yaml` ```yaml controllers: main: containers: main: image: repository: ghcr.io/mendhak/http-https-echo tag: 30 initContainers: a-container: image: repository: ghcr.io/mendhak/http-https-echo tag: 30 service: main: enabled: false persistence: config: enabled: true advancedMounts: main: main: - path: /data/config.yaml readOnly: false subPath: config.yaml ```Successful example (same as above, with initContainers commented)
`helm upgrade -i release-name bjw-s/app-template --version 2.0.0 -f values.yaml` ```yaml controllers: main: containers: main: image: repository: ghcr.io/mendhak/http-https-echo tag: 30 # initContainers: a-container: image: repository: ghcr.io/mendhak/http-https-echo tag: 30 service: main: enabled: false persistence: config: enabled: true advancedMounts: main: main: - path: /data/config.yaml readOnly: false subPath: config.yaml ```Error output
``` Error: UPGRADE FAILED: template: app-template/templates/common.yaml:14:3: executing "app-template/templates/common.yaml" at(Examples are a reduced version of advanced-values.yaml)
What did you expect to happen:
The chart should install successfully, with the volumeMounts rendered as expected for both main and init containers (or ignored completely, if
advancedMounts
was not designed to include init containers).Anything else you would like to add:
Additional Information:
I noticed that
controllers.*.initContainers.*.volumeMounts
is no longer applied (as in v1.5.1), and thatpersistence.globalMounts
applies to init containers. Does this imply thatpersistence.advancedMounts
was intended to also apply to init containers?