-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
TF: plan -refresh=false for google_compute_ha_vpn_gateway with gcs backend has resource replacement #12422
TF: plan -refresh=false for google_compute_ha_vpn_gateway with gcs backend has resource replacement #12422
Conversation
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
@akshat-jindal-nit can repro this issue with a test? Could we add that test? |
@harshithpatte-g this particular change is related to terraform plan -refresh=false related changes. I think we don't write any particulars tests for it. |
@rileykarson This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @rileykarson This PR has been waiting for review for 1 week. Please take a look! Use the label |
Tests analyticsTotal tests: 1069 Click here to see the affected service packages
🟢 All tests passed! View the build log |
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.
Were you able to test manually to confirm the fix? I'm a bit confused why this works, because we're removing what is traditionally the mitigation for the issue here.
Yes I test it manually and this particular change is fixing this particular issue. |
@rileykarson This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
Sorry, could you elaborate on how you've reproduced the issue? I continue to see it both before and after this change. Effectively, we assume that a refresh is performed after the upgrade- we'd resolve that with a StateUpgrader to infill the default value where it's null (but really, a full refresh would be better in case the live value is different). |
I perform these steps to reproduce the issue b/37636818
By removing the defaulting logic, the fixed version of the function ensures that Terraform accurately reflects the actual state of the gateway_ip_version attribute in Google Cloud. This prevents the false positive change detection and avoids unnecessary resource replacements. |
@GoogleCloudPlatform/terraform-team @rileykarson This PR has been waiting for review for 1 week. Please take a look! Use the label |
mmv1/templates/terraform/state_migrations/compute_ha_vpn_gateway.go.tmpl
Show resolved
Hide resolved
Tests analyticsTotal tests: 1073 Click here to see the affected service packages
🟢 All tests passed! View the build log |
…bsent during state upgrade
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.
The code looks good and this works on my machine to solve the original bug- just waiting for generate + test to LGTM and merge.
Tests analyticsTotal tests: 1073 Click here to see the affected service packages
🟢 All tests passed! View the build log |
…ckend has resource replacement (GoogleCloudPlatform#12422)
Bug: b/376368181
Issue: hashicorp/terraform-provider-google#19978
This particular change is the main culprit of this issue https://screenshot.googleplex.com/79xwUXBEcc5SYAg.
Looks like this issue start occurring from the release v5.40.0 https://screenshot.googleplex.com/367U6wou3dHnzaJ.
Release Note Template for Downstream PRs (will be copied)