-
-
Notifications
You must be signed in to change notification settings - Fork 998
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
run_cmd
in locals
block executed twice
#1427
Comments
run_cmd
in locals exectuted twicerun_cmd
in locals
block exectuted twice
If definitely happens to me too, I was about to report the same issue. |
Hm, must be an issue with the parsing logic, as it takes several passes to parse everything. If anyone has time to dig into this, help would be greatly appreciated, as we're quite booked right now. |
This happens because of checkVersionConstraints(), which leads to cli_app.go#L405. Since config.PartialParseConfigFile() always parses |
Oh, bummer. Any thoughts on how to fix this? |
Since `locals` can have side effects, we might run into cases when we don't need to pasre them. One example is `checkVersionConstraints()`, which is executed early on and relies on parsing Terraform. Closes: gruntwork-io#1427
@yorinasub17, in #1554 you had some great suggestions, do you already have a timeframe in which you plan to implement those? Is there any way one could help? We're currently discovering a lot of dynamic information with a some |
Should it be executed even when it's in negative
When running without |
Fixed in #1763 and released in https://github.com/gruntwork-io/terragrunt/releases/tag/v0.31.6. |
run_cmd
in locals
block exectuted twicerun_cmd
in locals
block executed twice
I think this may have regressed. I'm running v0.36.7 and the script is executing several times without caching the output:
locals {
config = yamldecode(file("${get_parent_terragrunt_dir()}/config.yml"))
deploy_type = trimspace(lower(run_cmd("sh", "${get_parent_terragrunt_dir()}/../bin/get-deploy-type.sh")))
# ... The bash script just prompts for valid input and only prints to stdout at the very end. Once all invocations of the script succeed, everything works as expected. Happy to know if I've just missed something. |
Hi, |
Hi there,
It seems a
run_cmd
inside alocals
block will be run twice.Reproducer:
terragrunt.hcl
notice two different UUIDs in the log, which I believe shows this is not just a double logging issue.
Thanks!
The text was updated successfully, but these errors were encountered: