-
Notifications
You must be signed in to change notification settings - Fork 32
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
get_var is not working in loops #972
Comments
I guess I run into the same issue with the following (simplified) piece of code:
Leads to this error:
According to the
I might be missing something about the current jinja2 context, but I was expected my My kluctl version is |
I can confirm that this is a bug and supposed to work, so the docs are correct, but the implementation is wrong. The For now, at least in regard to Regarding |
This issue seems to be more complicated then I thought. It's a combination of missing functionality in Jinja2 and bugs in go-jinja2. See this PR, which tries to fix it partially: #997 I'm not going to close this issue, at least until pallets/jinja#1478 is fixed. |
Operating system
macOS
Kluctl Version
2.23.3
Kubernetes Version
v1.26.12
kubectl Version
v1.29.1
Bug description
The function get_var is not working in a local context (e.g. for loops). For example, the following statement would always return
false
because get_var can't access the local context which contains theentry
object:I would expect that if
entry.enabled
is set totrue
, get_var also returnstrue
instead of the default valuefalse
.Steps to reproduce
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: