api: add Literal field to ValuesReference (CRD schema + docs)#1503
Open
gecube wants to merge 1 commit into
Open
api: add Literal field to ValuesReference (CRD schema + docs)#1503gecube wants to merge 1 commit into
gecube wants to merge 1 commit into
Conversation
Exposes the new `literal` field on `valuesFrom` entries, mirroring the addition to `meta.ValuesReference` in fluxcd/pkg#1218. When set together with `targetPath`, the referenced value is passed to Helm verbatim (equivalent of `helm --set-literal`) instead of being parsed by `strvals.ParseInto`, so file content containing commas, brackets, braces or equal signs survives the round-trip intact. This commit ships only the OpenAPI schema (so the field is validated by the API server) and the user-facing documentation. The runtime support lives in fluxcd/pkg/chartutil; once that PR merges and a `fluxcd/pkg` release is cut, a follow-up will bump the dependency here so helm-controller actually honours the field. Until then, setting `literal: true` is accepted by the API but has no effect — the field is forward-compatible. Addresses fluxcd#1317. Signed-off-by: George Gaál <gb12335@gmail.com>
5b1c0b8 to
564f026
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exposes the new
literalfield onvaluesFromentries, mirroring the addition tometa.ValuesReferencein fluxcd/pkg#1218.Motivation
valuesFromwithtargetPathruns the referenced value throughstrvals.ParseInto— the same parser ashelm --set. Anything containing,,[,],{,}or unescaped=is interpreted as Helm-set syntax, so arbitrary file content (Springapplication.ymlwith flow sequences, HOCONapplication.conf, JSON blobs, multi-line YAML, …) is misparsed or fails outright. Examples in the wild:The quote-wrap workaround from #298 is impractical when content arrives via Kustomize
configMapGenerator/secretGenerator(raw file → raw bytes in the CM, no opportunity to wrap). Flux's kustomize-controller disables Kustomize plugins so a generator/transformer-based wrap is also off the table.What this PR does
literal(bool, optional) to thevaluesFrom[]entries inhelmreleases.helm.toolkit.fluxcd.io. Validated by the API server.valuesFromsection ofdocs/spec/v2/helmreleases.mdwith a new bullet, a concrete YAML example, and a note about when to reach for it.What this PR does not do
fluxcd/pkg/chartutil(PR #1218).fluxcd/pkgdependency. Once pkg merges and ships a release, a follow-up here will pick it up — at that point settingliteral: truewill start actually doing something. Until then the field is accepted-but-ignored — forward-compatible behaviour.Resolves
fluxcd/helm-controller#1317. Addresses parts of #460, #853, flux2#1756.
Verified
make manifestsregenerates the CRD with the new field (kubebuilder annotation comes from the pkg PR via themeta.ValuesReference = type aliasinapi/v2/reference_types.go).chartutilchange picks up the new field end-to-end on a test cluster (chart-owned CM ends up with byte-identical content to the source, nostrvals.ParseIntomangling).