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

[Enhancement] Document usage of element0/element1 in addition to usage of elementIndex0/elementIndex0 in nestedforEach #1473

Open
iamsgarg-ob opened this issue Feb 14, 2025 · 5 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@iamsgarg-ob
Copy link

Description

The current documentation in nested foreach talks about

  • element - current element in the innermost loop in nested foreach
  • elementIndex - index of the element of the outer loop ( elementIndex0 ) and the inner loop ( elementIndex1 ) and so on..

however it does not reference that you can refer to the outer loop element as {{ element0 }} or that the inner loop element can be referenced as {{ element1 }} and so on.

It would be very helpful to document this so users of nested foreach's dont have to rely on anti patterns like assigning the outer loop element to some context variable and then referencing it in the inner loop.

Slack discussion

https://kubernetes.slack.com/archives/C032MM2CH7X/p1738808504370699

@iamsgarg-ob iamsgarg-ob added the enhancement New feature or request label Feb 14, 2025
Copy link

welcome bot commented Feb 14, 2025

Thanks for opening your first issue here! Be sure to follow the issue template!

@JimBugwadia JimBugwadia added the good first issue Good for newcomers label Feb 14, 2025
@120EE0980
Copy link
Contributor

I want to work on this issue.Will open a PR soon..

@Denish3436
Copy link

Pls assign to me, I want to work on this

@Denish3436
Copy link

Denish3436 commented Feb 14, 2025

/assign

@Denish3436
Copy link

@vishal-chdhry could you plz review my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

4 participants