Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(applicationset): explain impact of empty spec in templatePatch #17042

Merged
merged 2 commits into from
Jan 30, 2024
Merged
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
14 changes: 8 additions & 6 deletions docs/operator-manual/applicationset/Template.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,15 @@ In this example, the ApplicationSet controller will generate an `Application` re

## Template Patch

Templating is only available on string type. However, some uses cases may require to apply templating on other types.
Templating is only available on string type. However, some use cases may require applying templating on other types.

Example:

- Set the automated sync policy
- Switch prune boolean to true
- Add multiple helm value files

Argo CD has a `templatePatch` feature to allow advanced templating. It supports both json and yaml.
- Conditionally set the automated sync policy.
- Conditionally switch prune boolean to `true`.
- Add multiple helm value files from a list.

The `templatePatch` feature enables advanced templating, with support for `json` and `yaml`.

```yaml
apiVersion: argoproj.io/v1alpha1
Expand Down Expand Up @@ -174,3 +173,6 @@ spec:

The `spec.project` field is not supported in `templatePatch`. If you need to change the project, you can use the
`spec.project` field in the `template` field.

!!! important
When writing a `templatePatch`, you're crafting a patch. So, if the patch includes an empty `spec: # nothing in here`, it will effectively clear out existing fields. See [#17040](https://github.com/argoproj/argo-cd/issues/17040) for an example of this behavior.
Loading