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

Bug 1981941: Upgrade terraform to 0.14.6 #4729

Conversation

jhixson74
Copy link
Member

@jhixson74 jhixson74 commented Mar 9, 2021

This updates the installer to use Terraform 0.14.6.

Terraform 0.13.x updated the on-disk layout of the plugins directory, how to access offline plugins, and a lock file used for plugin versions. plugin_versions_generate.go has been added which generates plugin_versions.go. All terraform plugin files the installer uses have been updated to use the plugin version. All terraform config files have been updated to use the local providers. A terraform.rc file has been added to specify where the local providers are.

A temporary vendor path for terraform is in this PR that allows the location of the new plugin version lock file to be overridden. Once I can get everything green it will be added to our local terraform fork.

https://issues.redhat.com/browse/CORS-1520

https://www.terraform.io/docs/language/providers/requirements.html
https://www.terraform.io/docs/language/dependency-lock.html

@jhixson74 jhixson74 force-pushed the master_update_terraform_0.14.6 branch 7 times, most recently from 7727105 to 598340b Compare March 10, 2021 00:59
@jhixson74
Copy link
Member Author

/test e2e-azure
/test e2e-gcp

@jhixson74 jhixson74 force-pushed the master_update_terraform_0.14.6 branch 2 times, most recently from 71af547 to 8bb4f1f Compare March 10, 2021 21:36
@jhixson74
Copy link
Member Author

/test e2e-azure
/test e2e-gcp

@jhixson74 jhixson74 force-pushed the master_update_terraform_0.14.6 branch 7 times, most recently from 025f137 to 5c93088 Compare March 11, 2021 19:19
@jhixson74
Copy link
Member Author

/retest

@jhixson74
Copy link
Member Author

/retest
/test e2e-azure
/test e2e-gcp

@jhixson74 jhixson74 force-pushed the master_update_terraform_0.14.6 branch 2 times, most recently from 4cd1f4d to 06f77d7 Compare March 18, 2021 21:28
@jhixson74
Copy link
Member Author

/test e2e-azure
/test e2e-gcp

@jhixson74
Copy link
Member Author

/test e2e-gcp
/test e2e-openstack

@jhixson74 jhixson74 force-pushed the master_update_terraform_0.14.6 branch from 06f77d7 to 1c9bb61 Compare March 24, 2021 21:04
Copy link
Contributor

@staebler staebler left a comment

Choose a reason for hiding this comment

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

This looks really good. I have some concerns about how we are going about determining the version for the providers, but the overall course of this is spectacular.

pkg/terraform/exec/plugins/plugin_versions_generate.go Outdated Show resolved Hide resolved
pkg/terraform/exec/plugins/plugin_versions_generate.go Outdated Show resolved Hide resolved
pkg/terraform/exec/plugins/plugin_versions_generate.go Outdated Show resolved Hide resolved
pkg/terraform/exec/plugins/plugin_versions_generate.go Outdated Show resolved Hide resolved
pkg/asset/cluster/cluster.go Outdated Show resolved Hide resolved
pkg/terraform/exec/plugins/aws.go Outdated Show resolved Hide resolved
pkg/terraform/exec/plugins/plugin_versions_generate.go Outdated Show resolved Hide resolved
pkg/terraform/exec/plugins/plugin_versions_generate.go Outdated Show resolved Hide resolved
pkg/terraform/exec/plugins/plugin_versions_generate.go Outdated Show resolved Hide resolved
url = fmt.Sprintf("https://%s", path)
}

// git clone if directory doesn't exist, else git pull
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite follow why we need to get the repo and get the tags. Why is the version declared for the module not sufficient? Even if it is a psuedo version, it still starts with a semver.

Copy link
Contributor

Choose a reason for hiding this comment

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

Following up on this, I do notice that the semver in the psuedo version is not the same as the semver that terraform expects. I assume this is because of the dastardly v2 missing in many of the provider modules.

Copy link
Contributor

@staebler staebler left a comment

Choose a reason for hiding this comment

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

I also get a one-line change in vendor/github.com/hashicorp/terraform-plugin-test/v2/helper.go when I run go mod vendor.

diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/v2/helper.go b/vendor/github.com/hashicorp/terraform-plugin-test/v2/helper.go
index 87a15b30e..a2cc47050 100644
--- a/vendor/github.com/hashicorp/terraform-plugin-test/v2/helper.go
+++ b/vendor/github.com/hashicorp/terraform-plugin-test/v2/helper.go
@@ -145,7 +145,7 @@ func symlinkAuxiliaryProviders(pluginDir string) error {
                if filenameExt == ".zip" {
                        _, err = os.Stat(path)
                        if os.IsNotExist(err) {
-                               zipDecompressor.Decompress(path, filepath.Join(auxiliaryProviderDir, filename), false, 0000)
+                               zipDecompressor.Decompress(path, filepath.Join(auxiliaryProviderDir, filename), false)
                        } else if err != nil {
                                return fmt.Errorf("Unexpected error: %s", err)
                        }

go.mod Outdated Show resolved Hide resolved
Update terraform-provider-aws to 3.1.0
Update terraform-provider-azure to 2.48.0
Update terraform-provider-google to 3.40.0
Update plugin directory to use new terraform plugin paths. Add environment
variable that sets location of terraform.rc so that local terraform plugins can
be used.

New terraform provider requirements are documented here:

https://www.terraform.io/docs/language/providers/requirements.html
Add terraform.rc and update terraform modules to specify terraform version and
local provider locations.
@staebler staebler force-pushed the master_update_terraform_0.14.6 branch from 9b94a71 to 45516ea Compare December 14, 2021 15:00
@staebler
Copy link
Contributor

/test e2e-gcp
/test e2e-azure
/test e2e-azurestack

@staebler
Copy link
Contributor

Tests are passing to the extent expected.
Let's wait for #5484 to merge so that we can get a good signal for ovirt and openstack.
/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2021
@staebler
Copy link
Contributor

/test e2e-openstack
/test e2e-ovirt

@staebler
Copy link
Contributor

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 15, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 15, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: staebler

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@openshift-bot: This pull request references Bugzilla bug 1981941, which is invalid:

  • expected the bug to target the "4.10.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@staebler
Copy link
Contributor

/bugzilla refresh

@openshift-ci openshift-ci bot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Dec 16, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@staebler: This pull request references Bugzilla bug 1981941, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (gpei@redhat.com), skipping review request.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 1c44377 into openshift:master Dec 16, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@jhixson74: All pull requests linked via external trackers have merged:

Bugzilla bug 1981941 has been moved to the MODIFIED state.

In response to this:

Bug 1981941: Upgrade terraform to 0.14.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@jhixson74: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-openstack 45516ea link false /test e2e-openstack
ci/prow/e2e-ovirt 45516ea link false /test e2e-ovirt

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

miyamotoh added a commit to miyamotoh/installer that referenced this pull request Jan 20, 2022
Signed-off-by: Hiro Miyamoto <miyamotoh@us.ibm.com>
clnperez pushed a commit to openshift-powervs/installer that referenced this pull request Jan 20, 2022
Signed-off-by: Hiro Miyamoto <miyamotoh@us.ibm.com>
mjturek pushed a commit to mjturek/installer that referenced this pull request Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants