-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support multiple TF version constraints from module and improve…
… logging (#362) * feat: Support multiple TF version constaints from module * Improve logging on reading TF version constraint (moved from #361) * Align with https://github.com/hashicorp/terraform-config-inspect/blob/master/main.go#L35C2-L37 * Update `test-data/integration-tests/test_versiontf/version.tf` with multiple TF version constraints * Drop `required_providers` from `test-data/integration-tests/test_versiontf/version.tf` as `tfswitch` does not handle TF providers * Modified function to return an error in case of non matching constraints * Added testcase for non matching constraints * Moved failing testcase to skip-integration tests --------- Co-authored-by: Johannes Brunswicker <johannes.brunswicker@crownpeak.com> Co-authored-by: Hugh Wells <hugh@crablab.co.uk>
- Loading branch information
1 parent
e7404d4
commit 87853c8
Showing
6 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
terraform { | ||
required_version = "~> 1.0.0" | ||
} | ||
|
||
required_providers { | ||
aws = ">= 2.52.0" | ||
kubernetes = ">= 1.11.1" | ||
} | ||
} | ||
terraform { | ||
required_version = "<= 1.0.5" | ||
} |
11 changes: 11 additions & 0 deletions
11
test-data/skip-integration-tests/test_versiontf_non_matching_constraints/version.tf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
terraform { | ||
required_version = "~> 1.0.0" | ||
} | ||
|
||
terraform { | ||
required_version = "= 1.0.5" | ||
} | ||
|
||
terraform { | ||
required_version = "<= 1.0.4" | ||
} |