Repository navigation
Conversation
Discover *.tofu alongside *.tf in Terraform and Terragrunt modes. Tagged output keeps the input extension (main.tofu -> main.terratag.tofu) so a main.tf/main.tofu twin pair no longer races to write the same main.terratag.tf, and OpenTofu's twin precedence still holds after tagging. Re-runs skip *.terratag.tofu as well as *.terratag.tf. Adds tofu_file, tofu_file_with_tf_twin and tofu_already_tagged fixtures, a .tofu file to terragrunt_unit, and unit tests for discovery and rename.
Contributor
Author
|
Superseded by #247. Renaming the branch closed this PR, and GitHub cannot reopen it on the new branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Terratag only discovered
*.tffiles, so resources in OpenTofu*.tofufiles were never tagged. This PR discovers*.tofufiles interraform,terragruntandterragrunt-run-allmodes. Tagged output keeps the input file extension.Changes
*.tofualongside*.tfinGetFilePaths.main.tofubecomesmain.terratag.tofu. Before, amain.tf/main.tofutwin pair both wrotemain.terratag.tf. OpenTofu's rule that.tofutakes precedence over a same-named.tfstill holds after tagging.*.terratag.tofuas well as*.terratag.tfon re-runs..tofuhandling for-dir,-skipTerratagFilesand-rename.tofu_file,tofu_file_with_tf_twinandtofu_already_tagged, added toterraform_latest(so they also run underTestOpenTofu). Add a.tofufile toterragrunt_unit.TestGetFilePathsIncludesTofuFiles,TestReplaceWithTerratagFileKeepsExtension.Testing
SKIP_INTEGRATION_TESTS=1 go test ./...go vet ./...go fmt ./...TestTerraformlatest(Terraform 1.16.0)TestOpenTofu(OpenTofu 1.12.6)TestTerragruntWithCacheandTestTerragruntRunAll(Terragrunt 1.1.6, Terraform 1.16.0)