-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Support a list of values as string in the generators selectors #20943
Comments
Hello, can I take this issue? 🙂 |
Sure, go ahead ! It's Indeed a good idea to check only one is provided |
Thanks! |
I took a look at the issue. I am not sure that it is a good idea to add the spec:
goTemplate: true
generators:
- list:
elements:
- cluster: engineering-dev
url: https://kubernetes.default.svc
envs:
- staging
- prod
selector:
matchExpressions:
- key: env
operator: In
values: [`{{- range $index, $env := .envs }}{{ if $index }}, {{ end }}"{{ $env }}"{{- end }}`] The thing is we want to be as much close to the native Kubernetes API as possible. The struct for the |
You would still end up with a list of a single string. |
Summary
With the current state of applicationset templating, it's not possible to provide values as a list in a selector
matchExpressions
values, coming from variables defined in the generator or from another generator.Motivation
Let's take the example of this applicationset:
It's not possible to provide the
envs
variable in the selectorvalues
.Proposal
I would propose to add a field in the matchExpression, to support a list of values as string:
This would be a comma-separated list, as a string, that could be filled using templating functions:
The text was updated successfully, but these errors were encountered: