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

conditional go templating and looping #14138

Open
dberardo-com opened this issue Jan 30, 2025 · 0 comments
Open

conditional go templating and looping #14138

dberardo-com opened this issue Jan 30, 2025 · 0 comments
Labels
type/feature Feature request

Comments

@dberardo-com
Copy link

i am used to jinja if/else blocks and for loops, is it currently possible to achieve something like this in argo string templates?

basically i want to APPLY a k8s manifest in an argo workflow template and the spect part of the manifest depend on an input parameter. can i use something like this from jinja ?

{% if input.parameters.myVar == "test" %}
spec:
 a: {{ input.parameters.myVar }}
{% else %}
spec:
 b: {{ input.parameters.myVar }}
{% endif %}

the same is true for for loops (i guess it is called range in go template?

@dberardo-com dberardo-com added the type/feature Feature request label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Feature request
Projects
None yet
Development

No branches or pull requests

1 participant