I’m building a helm chart that can deploy one or more cronjobs. I’d like for the jobs to be able to use some basic defaults unless otherwise specified by the devs using a custom values file.
My chart uses range
for the entire file so that it can deploy multiple cronjobs, if defined, and uses with
to be able to access the “root” values as the defaults.
Basic key-value pairs work just fine using the default
function like below:
concurrencyPolicy: {{ default .Values.concurrencyPolicy $job.concurrencyPolicy }}
However, I’m running into problems with nested values:
image:
repository: {{ default .Values.image.repository $job.image.repository }}
# I get a "nil pointer evaluating $job.image.repository", as if it can't access sub-keys.
Any help would be appreciated.