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

ATMOS 1.10.1: Fix atmos CLI config processing. Improve logs.verbose #209

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

aknysh
Copy link
Member

@aknysh aknysh commented Oct 11, 2022

what

  • Fix atmos CLI config processing
  • Improve logs.verbose

why

  • Fix issues with CLI config processing introduced in Fix remote state for Terraform utils provider. Remove all global vars from Go code. Implement Logs.Verbose. Update terraform commands atmos#210
  • In Go, a struct is passed by value to a function (the whole struct is copied), so if the function modifies any struct fields, the changes are not visible from outside of the functions
  • The function processEnvVars was accepting the CLI config struct by value, checking the ENV var ATMOS_BASE_PATH and modifying the BasePath field - this modification was lost when the function returned resulting in the error from the utils provider "failed to find a match for the import ..." because the atmos base path was not set correctly (note that ATMOS_BASE_PATH ENV var is critical for the utils provider to work, and it's set by geodesic or by Spacelift scripts)
  • Changing the function to accept a pointer to the struct fixed the issue (the modified fields are visible to the calling code)

references

@aknysh aknysh added the patch A minor, backward compatible change label Oct 11, 2022
@aknysh aknysh self-assigned this Oct 11, 2022
@aknysh aknysh requested review from a team as code owners October 11, 2022 17:05
@aknysh aknysh merged commit c31fde6 into main Oct 11, 2022
@aknysh aknysh deleted the atmos-1.10.1 branch October 11, 2022 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants