From 57562de2595d449626bf2896e220db08db86ea64 Mon Sep 17 00:00:00 2001 From: Dieter Bocklandt Date: Mon, 5 Dec 2022 14:52:03 +0100 Subject: [PATCH] docs: update how to access arrays in Go templates (#11562) Signed-off-by: Dieter Bocklandt Signed-off-by: Dieter Bocklandt --- docs/operator-manual/applicationset/GoTemplate.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/operator-manual/applicationset/GoTemplate.md b/docs/operator-manual/applicationset/GoTemplate.md index 8f677c1435570..911754009ab14 100644 --- a/docs/operator-manual/applicationset/GoTemplate.md +++ b/docs/operator-manual/applicationset/GoTemplate.md @@ -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: @@ -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