-
-
Notifications
You must be signed in to change notification settings - Fork 964
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
fix: make terragrunt-fetch-dependency-output-from-state
to work with not applied dependencies
#3350
fix: make terragrunt-fetch-dependency-output-from-state
to work with not applied dependencies
#3350
Conversation
…h not applied dependencies Signed-off-by: Rodrigo Fior Kuntzer <[email protected]>
Looks like
|
Signed-off-by: Rodrigo Fior Kuntzer <[email protected]>
Thanks for the update @denis256 , I added a check that is terraform only and therefore it fails with tofu, I've amended the PR and fixed it, could you please run the tests once again? thanks in advance. |
test/integration_test.go
Outdated
rootTerragruntConfigPath := util.JoinPath(tmpEnvPath, TEST_FIXTURE_OUTPUT_FROM_REMOTE_STATE, config.DefaultTerragruntConfigPath) | ||
copyTerragruntConfigAndFillPlaceholders(t, rootTerragruntConfigPath, rootTerragruntConfigPath, s3BucketName, "not-used", "not-used") | ||
|
||
environmentPath := fmt.Sprintf("%s/%s/env1", tmpEnvPath, TEST_FIXTURE_OUTPUT_FROM_REMOTE_STATE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think filepath.Join()
will be more cross-platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually copied that code from the TestTerragruntOutputFromRemoteState
test above, but sure, make sense and thanks for the suggestion, I've fixed it.
test/integration_test.go
Outdated
stdout bytes.Buffer | ||
stderr bytes.Buffer | ||
) | ||
runTerragruntRedirectOutput(t, fmt.Sprintf("terragrunt init --terragrunt-fetch-dependency-output-from-state --terragrunt-non-interactive --terragrunt-working-dir %s/app2", environmentPath), &stdout, &stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runTerragruntCommandWithOutput()
- will also print output to terminal, will be helpful to debug why it is crashing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the suggestion, I've updated it.
Signed-off-by: Rodrigo Fior Kuntzer <[email protected]>
Quality Gate passedIssues Measures |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [gruntwork-io/terragrunt](https://github.com/gruntwork-io/terragrunt) | patch | `v0.66.8` -> `v0.66.9` | | [gruntwork-io/terragrunt](https://github.com/gruntwork-io/terragrunt) | patch | `0.66.8` -> `0.66.9` | --- ### Release Notes <details> <summary>gruntwork-io/terragrunt (gruntwork-io/terragrunt)</summary> ### [`v0.66.9`](https://github.com/gruntwork-io/terragrunt/releases/tag/v0.66.9) [Compare Source](https://github.com/gruntwork-io/terragrunt/compare/v0.66.8...v0.66.9) #### Updated CLI args, config attributes and blocks - `--terragrunt-fetch-dependency-output-from-state` #### Description - Fixed the `--terragrunt-fetch-dependency-output-from-state` feature flag to work correctly with non-applied dependencies. #### Special thanks Special thanks to [@​rodrigorfk](https://github.com/rodrigorfk) for their contribution! #### Related links - [gruntwork-io/terragrunt#3350 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/akrantz01/homelab). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Description
Fixes #3349 and #2261.
If you enable the
--terragrunt-fetch-dependency-output-from-state
feature flag and runs aterragrunt init
on a module that depends on a dependency that was not yet applied, terragrunt will fail, even if you are usingmock_outputs
. This fix is treating the returned error and checking if aNoSuchKey
error was produced, allowing terragrunt to proceed if that was the case.TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Fix
--terragrunt-fetch-dependency-output-from-state
feature flag and allows it to work with not applied dependenciesMigration Guide