-
Notifications
You must be signed in to change notification settings - Fork 779
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
Allow for templatefile recursion (up to 1024 depth default) #1250
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reminder for the PR assignee: If this is a user-visible change, please update the changelog as part of the PR. |
cam72cam
force-pushed
the
recursive_templatefile_implementation
branch
2 times, most recently
from
February 28, 2024 16:39
22e8e99
to
909a210
Compare
cam72cam
changed the title
[DRAFT] Allow for templatefile recursion (up to 1024 depth)
Allow for templatefile recursion (up to 1024 depth default)
Feb 28, 2024
janosdebugs
reviewed
Mar 6, 2024
cube2222
previously approved these changes
Mar 11, 2024
cube2222
previously approved these changes
Mar 11, 2024
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Janos <86970079+janosdebugs@users.noreply.github.com> Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
cam72cam
force-pushed
the
recursive_templatefile_implementation
branch
from
March 11, 2024 12:34
c36b501
to
ae27de9
Compare
janosdebugs
approved these changes
Mar 11, 2024
IgnorantSapient
pushed a commit
to IgnorantSapient/opentofu
that referenced
this pull request
Apr 1, 2024
…#1250) Signed-off-by: Christian Mesh <christianmesh1@gmail.com> Co-authored-by: Janos <86970079+janosdebugs@users.noreply.github.com> Signed-off-by: Ashwin Annamalai <4549937+IgnorantSapient@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes templatefile to track call depth when building templatefile functions. It works fine, even when nested inside other function calls.
As mentioned in #402, due to the lack of tail recursion it can be memory intensive during evaluation. In my opinion this is a reasonable trade off and the default max depth should prevent most OOM crashes during reasonable use.
Example:
With
TF_LOG=debug
TODO:
Resolves #402
Target Release
1.7.0