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: locals.tf.json getting overwritten #746

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Conversation

jakeyheath
Copy link
Contributor

@jakeyheath jakeyheath commented Oct 4, 2022

Summary

Fix a bug in the TFE config feature of fogg that was overwritting existing locals.tf.json

Test Plan

  • TestTFEConfigOmitEmpty
  • TestTFEConfig

Not table tests, but both verify this bug doesn't exist anymore. One verifies the output of locals.tf.json doesn't include "null" values in the string if before an optional argument was provided. The other makes sure that if an existing locals.tf.json exists, we preserve the values.

@jakeyheath jakeyheath requested a review from a team as a code owner October 4, 2022 19:10
@jakeyheath jakeyheath requested a review from alldoami October 4, 2022 19:10
@jakeyheath jakeyheath enabled auto-merge (squash) October 4, 2022 19:24
Comment on lines +228 to +229
// only create the locals.tf.json template is one doesn't exist yet
tfePath := filepath.Join(rootPath, "tfe", "locals.tf.json")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could join with path since that already joined the first 2 items:

Suggested change
// only create the locals.tf.json template is one doesn't exist yet
tfePath := filepath.Join(rootPath, "tfe", "locals.tf.json")
// only create the locals.tf.json template if one doesn't exist yet
tfePath := filepath.Join(path, "locals.tf.json")

@jakeyheath jakeyheath merged commit 12b4077 into main Oct 4, 2022
@jakeyheath jakeyheath deleted the heathj/fix-tfe-config branch October 4, 2022 19:30
@jakeyheath jakeyheath requested review from hspitzley-czi and a team October 4, 2022 19:45
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