Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docs more #1

Merged
merged 1 commit into from
Aug 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 47 additions & 58 deletions docs/operator-manual/applicationset/Generators-Matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,76 +172,65 @@ with the label `kubernetes.io/environment: dev` will have only dev-specific conf

1. You should specify only a single generator per array entry, eg this is not valid:

```yaml
- matrix:
generators:
- list: # (...)
git: # (...)
```
- matrix:
generators:
- list: # (...)
git: # (...)

- While this *will* be accepted by Kubernetes API validation, the controller will report an error on generation. Each generator should be specified in a separate array element, as in the examples above.

1. The Matrix generator does not currently support [`template` overrides](Template.md#generator-templates) specified on child generators, eg this `template` will not be processed:

```yaml
- matrix:
generators:
- list:
elements:
- # (...)
template: { } # Not processed
```
- matrix:
generators:
- list:
elements:
- # (...)
template: { } # Not processed

1. Combination-type generators (matrix or merge) can only be nested once. For example, this will not work:

```yaml
- matrix:
generators:
- matrix:
generators:
- matrix: # This third level is invalid.
generators:
- list:
elements:
- # (...)
```
- matrix:
generators:
- matrix:
generators:
- matrix: # This third level is invalid.
generators:
- list:
elements:
- # (...)

1. When using parameters from one child generator inside another child generator, the child generator that *consumes* the parameters **must come after** the child generator that *produces* the parameters.
For example, the below example would be invalid (cluster-generator must come after the git-files generator):

```yaml
- matrix:
generators:
# cluster generator, 'child' #1
- clusters:
selector:
matchLabels:
argocd.argoproj.io/secret-type: cluster
kubernetes.io/environment: '{{path.basename}}' # {{path.basename}} is produced by git-files generator
# git generator, 'child' #2
- git:
repoURL: https://github.com/argoproj/applicationset.git
revision: HEAD
files:
- path: "examples/git-generator-files-discovery/cluster-config/**/config.json"
```
- matrix:
generators:
# cluster generator, 'child' #1
- clusters:
selector:
matchLabels:
argocd.argoproj.io/secret-type: cluster
kubernetes.io/environment: '{{path.basename}}' # {{path.basename}} is produced by git-files generator
# git generator, 'child' #2
- git:
repoURL: https://github.com/argoproj/applicationset.git
revision: HEAD
files:
- path: "examples/git-generator-files-discovery/cluster-config/**/config.json"

1. You cannot have both child generators consuming parameters from each another. In the example below, the cluster generator is consuming the `{{path.basename}}` parameter produced by the git-files generator, whereas the git-files generator is consuming the `{{name}}` parameter produced by the cluster generator. This will result in a circular dependency, which is invalid.

```yaml
- matrix:
generators:
# cluster generator, 'child' #1
- clusters:
selector:
matchLabels:
argocd.argoproj.io/secret-type: cluster
kubernetes.io/environment: '{{path.basename}}' # {{path.basename}} is produced by git-files generator
# git generator, 'child' #2
- git:
repoURL: https://github.com/argoproj/applicationset.git
revision: HEAD
files:
- path: "examples/git-generator-files-discovery/cluster-config/engineering/{{name}}**/config.json" # {{name}} is produced by cluster generator
```

- matrix:
generators:
# cluster generator, 'child' #1
- clusters:
selector:
matchLabels:
argocd.argoproj.io/secret-type: cluster
kubernetes.io/environment: '{{path.basename}}' # {{path.basename}} is produced by git-files generator
# git generator, 'child' #2
- git:
repoURL: https://github.com/argoproj/applicationset.git
revision: HEAD
files:
- path: "examples/git-generator-files-discovery/cluster-config/engineering/{{name}}**/config.json" # {{name}} is produced by cluster generator