Skip to content

docs: document literal field on valuesFrom - #1503

Merged
matheuscscp merged 1 commit into
fluxcd:mainfrom
gecube:feat/valuesfrom-literal
Jun 4, 2026
Merged

docs: document literal field on valuesFrom#1503
matheuscscp merged 1 commit into
fluxcd:mainfrom
gecube:feat/valuesfrom-literal

Conversation

@gecube

@gecube gecube commented May 25, 2026

Copy link
Copy Markdown
Contributor

Closes: fluxcd/flux2#2625

Adds the user-facing documentation for the new literal field on valuesFrom entries.

Context

The new field has two parts:

  1. OpenAPI schema in config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml — already landed via Update to Kubernetes 1.36 and Go 1.26 #1506 (k8s 1.36 / Go 1.26 bump regenerated the CRD and picked up the Literal field from the meta package).
  2. Runtime support in fluxcd/pkg/chartutil — in flight as fluxcd/pkg#1218. Once that merges and a release is cut, a follow-up here will bump the dependency so helm-controller actually honours the field.

This PR fills in the missing third piece: the user-facing reference in docs/spec/v2/helmreleases.md. Until pkg ships, setting literal: true is accepted-but-ignored — forward-compatible behaviour.

Motivation

valuesFrom with targetPath runs the referenced value through strvals.ParseInto — the same parser as helm --set. Anything containing ,, [, ], {, } or unescaped = is interpreted as Helm-set syntax, so arbitrary file content (Spring application.yml with flow sequences, HOCON application.conf, JSON blobs, multi-line YAML, …) is misparsed or fails outright. Examples in the wild:

error parsing index: strconv.Atoi: parsing " \"prometheus\", \"health\", \"info\" ": invalid syntax
key "efm" has no value (cannot end with ,)

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's in this PR

  • New literal (Optional) bullet in the valuesFrom subkey list.
  • Concrete YAML example using literal: true with a kustomize-style raw file payload.
  • Short call-out at the bottom of the valuesFrom section pointing users to literal: true when their content contains ,, [, ], {, }, =.

Resolves

fluxcd/helm-controller#1317. Addresses parts of #460, #853, flux2#1756.

@gecube
gecube force-pushed the feat/valuesfrom-literal branch from 5b1c0b8 to 564f026 Compare May 25, 2026 10:23
@matheuscscp

Copy link
Copy Markdown
Member

@gecube Please rebase, the changes in the CRD YAML were done here: #1506

So this PR should contain only the docs 🙏

The OpenAPI schema for the new `literal` field on `valuesFrom` entries
landed via the CRD regeneration in fluxcd#1506 (k8s 1.36 / Go 1.26 bump,
which picked up the corresponding field from the regenerated meta
package). This commit ships only the matching user-facing documentation
in docs/spec/v2/helmreleases.md.

The runtime support lives in fluxcd/pkg/chartutil (fluxcd/pkg#1218);
once that merges and a release is cut, a follow-up here will bump the
dependency so helm-controller actually honours the field. Until then,
setting `literal: true` is accepted by the API but has no effect.

Addresses fluxcd#1317. Closes fluxcd/flux2#2625.

Signed-off-by: George Gaál <gb12335@gmail.com>
@gecube
gecube force-pushed the feat/valuesfrom-literal branch from 564f026 to b98cd99 Compare June 4, 2026 14:41
@gecube gecube changed the title api: add Literal field to ValuesReference (CRD schema + docs) docs: document literal field on valuesFrom Jun 4, 2026
@gecube

gecube commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@matheuscscp done. thanks.

@matheuscscp matheuscscp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@matheuscscp
matheuscscp merged commit ef8ecda into fluxcd:main Jun 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HelmRelease valuesFrom kind secret with comma separated values (cannot end with ,)

2 participants