-
Notifications
You must be signed in to change notification settings - Fork 116
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
tfexec: Add -allow-deferral
experimental options to Plan
and Apply
commands
#447
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
399b96b
initial addition, need to add version checks
austinvalle 76dbbc5
update with version checks
austinvalle e0fa5cb
add docs
austinvalle 52cd37b
add dashes
austinvalle f6fcad1
remove add space
austinvalle a93f388
update changelog
austinvalle ce1bfe7
add skip for darwin/arm
austinvalle 7a33242
increase the timeout
austinvalle a1abb29
wrong timeout lol
austinvalle 3dbe350
Merge branch 'main' into av/allow-deferral
austinvalle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ var ( | |
tf1_1_0 = version.Must(version.NewVersion("1.1.0")) | ||
tf1_4_0 = version.Must(version.NewVersion("1.4.0")) | ||
tf1_6_0 = version.Must(version.NewVersion("1.6.0")) | ||
tf1_9_0 = version.Must(version.NewVersion("1.9.0")) | ||
) | ||
|
||
// Version returns structured output from the terraform version command including both the Terraform CLI version | ||
|
@@ -180,6 +181,22 @@ func (tf *Terraform) compatible(ctx context.Context, minInclusive *version.Versi | |
return nil | ||
} | ||
|
||
// experimentsEnabled asserts the cached terraform version has experiments enabled in the executable, | ||
// and returns a well known error if not. Experiments are enabled in alpha and (potentially) dev builds of Terraform. | ||
func (tf *Terraform) experimentsEnabled(ctx context.Context) error { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would've probably called this |
||
tfv, _, err := tf.Version(ctx, false) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
preRelease := tfv.Prerelease() | ||
if preRelease == "dev" || strings.Contains(preRelease, "alpha") { | ||
return nil | ||
} | ||
|
||
return fmt.Errorf("experiments are not enabled in version %s, as it's not an alpha or dev build", errorVersionString(tfv)) | ||
} | ||
|
||
func stripPrereleaseAndMeta(v *version.Version) *version.Version { | ||
if v == nil { | ||
return nil | ||
|
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipping to avoid this error: https://github.com/hashicorp/terraform-exec/actions/runs/8914271134/job/24481540878?pr=447
An unfortunate situation where the latest macos GHA runners now are macOS 14 and ARM64 architecture machines: https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/. We ran into this issue on
setup-terraform
last week: hashicorp/setup-terraform#409I'm not sure if we want to default fallback to
amd64
or if skipping this onarm64
is acceptable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think skipping on arm64 is acceptable given that the nature of the test is to check for version differences, not so much architecture differences, and the former is already being checked on other platforms as well.