Skip to content

Commit

Permalink
docs: add documentation for child elements of path (#14044) (#14054)
Browse files Browse the repository at this point in the history
* docs: add documentation for child elements of path

When using go templating, the parent `{{ path }}` becomes `{{ .path.path }}, however, the other values are not at `{{ .path.path.* }}`, but at `{{ .path.* }}`.

This documentation update seeks to make this easier to understand since we just ran into this.



* Update docs/operator-manual/applicationset/GoTemplate.md




---------

Signed-off-by: Morre <[email protected]>
Signed-off-by: Morre <[email protected]>
Co-authored-by: Morre <[email protected]>
Co-authored-by: Michael Crenshaw <[email protected]>
  • Loading branch information
3 people authored Jun 14, 2023
1 parent 6ed3d61 commit fe276bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/operator-manual/applicationset/GoTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ By activating Go Templating, `{{ .path }}` becomes an object. Therefore, some ch
generators' templating:

- `{{ path }}` becomes `{{ .path.path }}`
- `{{ path.basename }}` becomes `{{ .path.basename }}`
- `{{ path.basenameNormalized }}` becomes `{{ .path.basenameNormalized }}`
- `{{ path.filename }}` becomes `{{ .path.filename }}`
- `{{ path.filenameNormalized }}` becomes `{{ .path.filenameNormalized }}`
- `{{ path[n] }}` becomes `{{ index .path.segments n }}`

Here is an example:
Expand Down

0 comments on commit fe276bc

Please sign in to comment.