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

Share Env attributes with cfgOptions. #2274

Conversation

jlepere-everlaw
Copy link
Contributor

@jlepere-everlaw jlepere-everlaw commented Sep 12, 2022

Description

In #1823, functionality was added to check module dependencies during destroy operations. This included creating a fresh TerragruntOptions object which, by default, has an empty map for the Env attribute. This means we're losing all environment variables when checking for dependencies.

Fixes #2273.

Release Notes (draft)

Updated FindWhereWorkingDirIsIncluded to include Env in the TerragruntOptions object for validating module dependencies for destroy operations.

In gruntwork-io#1823, functionality was added to check module dependencies during
destroy operations. This included creating a fresh `TerragruntOptions`
object [1] which, by default, has an empty map for the `Env` attribute [2].
This means we're losing all environment variables when checking for
dependencies.

[1] https://github.com/gruntwork-io/terragrunt/pull/1823/files#diff-2ce1e65bb8a23011007dae779c8bacbc45d28560b1bc4e7dc1079f52fd22cf14R504
[2] https://github.com/gruntwork-io/terragrunt/blob/7788a525ab61641211e3f8a127ed53b450e96bc8/options/options.go#L256
@jlepere-everlaw
Copy link
Contributor Author

I've verified this change locally with $ go run main.go destroy --terragrunt-working-dir ... against my organizations terragrunt configuration. Please let me know if there is more I can do for testing!

@denis256 denis256 merged commit 9881447 into gruntwork-io:master Sep 13, 2022
@jlepere-everlaw jlepere-everlaw deleted the bug/pass-env-in-terragrunt-option branch September 13, 2022 14:03
@jlepere-everlaw
Copy link
Contributor Author

Thanks, @denis256!

@denis256
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass Env to cfgOptions in FindWhereWorkingDirIsIncluded
2 participants