The matchExpressions selector in a git generator, part of a matrix generator, cannot use parameters from the other generator with goTemplate: true #17610
When trying to refer to a parameter in a matchExpressions post selector in a git generator, which is part of a matrix generator, where the parameter is derived from the other generator, part of the matrix generator, the following error is produced:
failed to get params for second generator in the matrix generator: child generator returned an error on parameter generation: error parsing label selector: key: Invalid value: "{{(index . .name).appEnabled}}": name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')
The whole idea behind this is to be able to control the enablement of the application for a particular cluster via a centralized config file and an enable flag for each cluster.
Checklist:
argocd version
.Describe the bug
When trying to refer to a parameter in a
matchExpressions
post selector in a git generator, which is part of a matrix generator, where the parameter is derived from the other generator, part of the matrix generator, the following error is produced:The whole idea behind this is to be able to control the enablement of the application for a particular cluster via a centralized config file and an enable flag for each cluster.
This might be partially related to https://github.com/argoproj/argo-cd/issues/12524.
To Reproduce
The following snippet can be used to reproduce the issue:
The content of the
config.yml
file, used in the git generator, is as follows:Expected behavior
I expect to be able to use the
.name
parameter, derived from the cluster generator, and Go templates in the post selector of the git generator.Screenshots
A screenshot depicting the error message:
Version