Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,17 @@ spec:
- Secret
- ConfigMap
type: string
literal:
description: |-
Literal marks this ValuesReference as a literal value. When set in
combination with TargetPath, the referenced value is merged at the target
path without interpreting Helm's `--set` syntax (commas, brackets, dots,
equal signs, etc.), mirroring the behavior of `helm --set-literal`. This
is the only safe way to inject arbitrary file content (config files, JSON
blobs, multi-line strings containing special characters) through
`valuesFrom`. Has no effect when TargetPath is empty: in that mode the
referenced value is always YAML-merged at the root.
type: boolean
name:
description: |-
Name of the values referent. Should reside in the same namespace as the
Expand Down
17 changes: 17 additions & 0 deletions docs/spec/v2/helmreleases.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,13 @@ An item on the list offers the following subkeys:
`true`, a not found error for the values reference is ignored, but any
`valuesKey`, `targetPath` or transient error will still result in a
reconciliation failure. Defaults to `false` when omitted.
- `literal` (Optional): When set together with `targetPath`, the referenced
value is merged at the target path verbatim, without interpreting Helm's
`--set` syntax (commas, brackets, dots, equal signs, etc.). Mirrors the
behavior of `helm --set-literal`. Use this to inject arbitrary file content
(config files, JSON blobs, multi-line strings containing special characters)
through `valuesFrom`. Has no effect when `targetPath` is empty.
Defaults to `false` when omitted.

```yaml
spec:
Expand All @@ -499,6 +506,11 @@ spec:
valuesKey: crt
targetPath: tls.crt
optional: true
- kind: ConfigMap
name: app-config-source
valuesKey: application.yml
targetPath: 'externalConfig.application\.yml.content'
literal: true
```

**Note:** The `targetPath` supports the same formatting as you would supply as
Expand All @@ -510,6 +522,11 @@ a list). You can read more about the available formats and limitations in the
For JSON strings, the [limitations are the same as while using `helm`](https://github.com/helm/helm/issues/5618)
and require you to escape the full JSON string (including `=`, `[`, `,`, `.`).

To skip the `--set`-style parsing entirely and pass the value as a raw string
(useful for full config files or any content containing `,`, `[`, `]`, `{`,
`}`, `=`), set `literal: true` together with `targetPath`. This mirrors
`helm --set-literal`.

To make a HelmRelease react immediately to changes in the referenced Secret
or ConfigMap see [this](#reacting-immediately-to-configuration-dependencies)
section.
Expand Down