-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support loading Helm values from different source types #1836
Conversation
Reading values from a file is a bit odd -- the path is given in the HelmRelease, but refers to a file in the filesystem of the operator. This is a trapeze act too far, in my opinion (see #1468 for previous discussion. I see I used the trapeze metaphor there as well; I need to find another). |
I'm not against fetching values from URLs -- though it's not very "GitOps", I think on balance it's reasonable to give people some flexibility on where the values come from. (Or to put it another way: it's not something I'd do myself, but who am I to judge ...). |
I do agree with you that reading values from a file is a bit odd, but at the same time I think it is also oddly specific to create a |
e360764
to
3dbf83b
Compare
3dbf83b
to
4f9d7d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
12/10 would review again
There's a couple of mechanical fixes I spotted; and, a suggestion about the CRD schema for you to consider.
22a50d4
to
ad9cfbf
Compare
`valuesFrom` supports different types of sources: `configMapKeyRef`, `secretKeyRef` and `externalSourceRef`. Where the latter can be used to retrieve a values file from an URL by setting the `externalSourceRef.URL`. The array of sources is merged in specified order, with the `.spec.values` getting merged last. For backwards compatiblity the old `valuesFromSecrets` are transformed into `secretKeyRef`s and lined up in front of any specified `valuesFrom` sources. On all source types the `<sourceRef>.Optional` can be set to `true` to allow the release of a Helm chart to continue if the values file could not be found.
ad9cfbf
to
46315e3
Compare
@squaremo I think this is now to your liking. |
type: string | ||
optional: | ||
type: boolean | ||
oneOf: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I didn't know the directive could go here, but this works.
Fixes #1809
valuesFrom
supports different types of sources:configMapKeyRef
,secretKeyRef
andexternalSourceRef
. Where the latter can be used toretrieve a values file from an URL by setting the
externalSourceRef.URL
. The array of sources is merged in specifiedorder, with the
.spec.values
getting merged last.For backwards compatiblity the old
valuesFromSecrets
are transformedinto
secretKeyRef
s and lined up in front of any specifiedvaluesFrom
sources.On all source types the
<sourceRef>.Optional
can be set totrue
toallow the release of a Helm chart to continue if the values file could
not be found.