Skip to content

Commit

Permalink
docs: revert appset path.path and path.segments docs (#10254)
Browse files Browse the repository at this point in the history
* docs: revert appset path.path and path.segments docs

Signed-off-by: CI <michael@crenshaw.dev>

* more

Signed-off-by: CI <michael@crenshaw.dev>
  • Loading branch information
crenshaw-dev committed Aug 9, 2022
1 parent 15965b8 commit 3d06d82
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
source:
repoURL: https://github.com/infra-team/cluster-deployments.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: http://kubernetes.default.svc
namespace: '{{path.basename}}'
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
source:
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: '{{server}}'
namespace: '{{path.basename}}'
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
source:
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: '{{url}}'
namespace: '{{path.basename}}'
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
source:
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: '{{url}}'
namespace: '{{path.basename}}'
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
source:
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: '{{url}}'
namespace: '{{path.basename}}'
2 changes: 1 addition & 1 deletion applicationset/generators/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (g *GitGenerator) filterApps(Directories []argoprojiov1alpha1.GitDirectoryG
}

func (g *GitGenerator) generateParamsFromApps(requestedApps []string, _ *argoprojiov1alpha1.ApplicationSetGenerator, useGoTemplate bool) []map[string]interface{} {
// TODO: At some point, the appicationSetGenerator param should be used
// TODO: At some point, the applicationSetGenerator param should be used

res := make([]map[string]interface{}, len(requestedApps))
for i, a := range requestedApps {
Expand Down
12 changes: 6 additions & 6 deletions docs/operator-manual/applicationset/Generators-Git.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ spec:
- path: applicationset/examples/git-generator-directory/cluster-addons/*
template:
metadata:
name: '{{path.segments[0]}}'
name: '{{path[0]}}'
spec:
project: "my-project"
source:
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: https://kubernetes.default.svc
namespace: '{{path.basename}}'
Expand All @@ -60,8 +60,8 @@ spec:

The generator parameters are:

- `{{path.path}}`: The directory paths within the Git repository that match the `path` wildcard.
- `{{path.segments[n]}}`: The directory paths within the Git repository that match the `path` wildcard, split into array elements (`n` - array index)
- `{{path}}`: The directory paths within the Git repository that match the `path` wildcard.
- `{{path[n]}}`: The directory paths within the Git repository that match the `path` wildcard, split into array elements (`n` - array index)
- `{{path.basename}}`: For any directory path within the Git repository that matches the `path` wildcard, the right-most path name is extracted (e.g. `/directory/directory2` would produce `directory2`).
- `{{path.basenameNormalized}}`: This field is the same as `path.basename` with unsupported characters replaced with `-` (e.g. a `path` of `/directory/directory_2`, and `path.basename` of `directory_2` would produce `directory-2` here).

Expand Down Expand Up @@ -100,7 +100,7 @@ spec:
source:
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: https://kubernetes.default.svc
namespace: '{{path.basename}}'
Expand Down Expand Up @@ -181,7 +181,7 @@ spec:
source:
repoURL: https://github.com/example/example-repo.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: https://kubernetes.default.svc
namespace: '{{path.basename}}'
Expand Down
2 changes: 1 addition & 1 deletion docs/operator-manual/applicationset/Generators-Matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
source:
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
path: '{{path.path}}'
path: '{{path}}'
destination:
server: '{{server}}'
namespace: '{{path.basename}}'
Expand Down
2 changes: 1 addition & 1 deletion docs/operator-manual/applicationset/GoTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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 `{{ .path.segments[n] }}`

Here is an example:

Expand Down

0 comments on commit 3d06d82

Please sign in to comment.