Skip to content

Commit

Permalink
docs: update how to access arrays in Go templates (#11562)
Browse files Browse the repository at this point in the history
Signed-off-by: Dieter Bocklandt <dieterbocklandt@gmail.com>

Signed-off-by: Dieter Bocklandt <dieterbocklandt@gmail.com>
  • Loading branch information
siliconsheep authored and crenshaw-dev committed Dec 5, 2022
1 parent 3b8b4c1 commit 57562de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/operator-manual/applicationset/GoTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ By activating Go Templating, `{{ .path }}` becomes an object. Therefore, some ch
generators' templating:

- `{{ path }}` becomes `{{ .path.path }}`
- `{{ path[n] }}` becomes `{{ .path.segments[n] }}`
- `{{ path[n] }}` becomes `{{ index .path.segments n }}`

Here is an example:

Expand Down Expand Up @@ -155,7 +155,7 @@ It is also possible to use Sprig functions to construct the path variables manua
| `{{path.filename}}` | `{{.path.filename}}` | `{{.path.filename}}` |
| `{{path.basenameNormalized}}` | `{{.path.basenameNormalized}}` | `{{normalize .path.path}}` |
| `{{path.filenameNormalized}}` | `{{.path.filenameNormalized}}` | `{{normalize .path.filename}}` |
| `{{path[N]}}` | `{{.path.segments[N]}}` | `{{index (splitList "/" .path.path) N}}` |
| `{{path[N]}}` | `-` | `{{index .path.segments N}}` |

## Examples

Expand Down

0 comments on commit 57562de

Please sign in to comment.