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

Handle terraform init flags removed in 0.15 #120

Merged
merged 1 commit into from
Jan 15, 2021
Merged

Conversation

kmoe
Copy link
Member

@kmoe kmoe commented Jan 15, 2021

From the Terraform 0.15 CHANGELOG:

  • The -lock and -lock-timeout options are no longer available on terraform init [GH-27464]
  • The -verify-plugins=false option is no longer available on terraform init. (Terraform now always verifies plugins.) [GH-27461]
  • The -get-plugins=false option is no longer available on terraform init. (Terraform now always installs plugins.) [GH-27463]

This PR adds a compatibility error if the user attempts to set these options when using Terraform 0.15 and above. We maintain the existing behaviour of passing default values for these options prior to 0.15.

This fixes the errors seen in the nightly master test run (example).

@kmoe kmoe requested review from paultyng and radeksimko January 15, 2021 17:15
@kmoe kmoe marked this pull request as ready for review January 15, 2021 17:15
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

Just one (not blocking) question/comment.

args = append(args, "-verify-plugins="+fmt.Sprint(c.verifyPlugins))

// boolean opts removed in 0.15: pass if <0.15
err = tf.compatible(ctx, nil, tf0_15_0)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Should we also gate these flags on the other end (minimum version), similar to how we gate fmt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, added #121 as it's a somewhat bigger job to go through and find the minimum versions for all flags, which might as well be done all at once. Merging this PR now so we can see if the next nightly passes.

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