Skip to content

Commit

Permalink
docs: document metadata access for go-templated cluster generator (ar…
Browse files Browse the repository at this point in the history
…goproj#10929)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: emirot <emirot.nolan@gmail.com>
  • Loading branch information
crenshaw-dev authored and emirot committed Jan 27, 2023
1 parent 826d59b commit 44c415b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/operator-manual/applicationset/GoTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ All your templates must replace parameters with GoTemplate Syntax:

Example: `{{ some.value }}` becomes `{{ .some.value }}`

### Cluster Generators

By activating Go Templating, `{{ .metadata }}` becomes an object.

- `{{ metadata.labels.my-label }}` becomes `{{ index .metadata.labels "my-label" }}`
- `{{ metadata.annotations.my/annotation }}` becomes `{{ index .metadata.annotations "my/annotation" }}`

### Git Generators

By activating Go Templating, `{{ .path }}` becomes an object. Therefore, some changes must be made to the Git
Expand Down

0 comments on commit 44c415b

Please sign in to comment.