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

Fix an error when trying to load default variables #719

Conversation

jocgir
Copy link

@jocgir jocgir commented Nov 5, 2024

I simply removed a lot of code that was handling error recovery. The new library we use returns the desired values even if there are error in the code. So, there is no need to try the whole retry process.

Generated

This pull request includes several changes to the util/terraform.go file, primarily aimed at simplifying the code and removing unnecessary functionality. The most important changes include the removal of unused imports, the elimination of redundant retry logic, and the deletion of the createTerraformVariablesTemporaryFolder function. Additionally, minor adjustments were made to the test cases in util/terraform_test.go.

Code simplification and cleanup:

  • Removed unused imports path, regexp, and utils from util/terraform.go.
  • Removed the reTfVariables regex and the isOverride function, as they are no longer needed. [1] [2]
  • Simplified the loadDefaultValues function by removing the retry mechanism and associated temporary folder creation logic. [1] [2]

Test adjustments:

  • Updated the TestLoadDefaultValues function in util/terraform_test.go to remove the test case for an invalid folder, which is no longer applicable.

I simply removed a lot of code that was handling error recovery. The new library we use returns the desired values even if there are error in the code.
@jocgir jocgir requested a review from a team as a code owner November 5, 2024 14:01
@jocgir jocgir changed the title Fix an error when trying to load default varaibles Fix an error when trying to load default variables Nov 5, 2024
@jocgir jocgir merged commit 4cd5aa1 into master Nov 12, 2024
11 checks passed
@jocgir jocgir deleted the DT-7358-TGF-Image-v4.1-report-errors-when-the-terraform-syntax-is-not-perfectly-valid-before-applying-gotemplate branch November 12, 2024 13:29
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.

2 participants