-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Enhance subnetwork.yaml to allow purpose field to be patch-able #12922
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
Enhance subnetwork.yaml to allow purpose field to be patch-able #12922
Conversation
Added necessary code to make 'purpose' field updatable.
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @melinath, 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. |
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.
In addition to the change requested below, please add this field to an update test: https://googlecloudplatform.github.io/magic-modules/test/test/#add-an-update-test
Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
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.
As previously requested, please add this field to an update test: https://googlecloudplatform.github.io/magic-modules/test/test/#add-an-update-test
@gvijbha, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. This notification can be disabled with the |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Tests analyticsTotal tests: 1125 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
1 similar comment
Tests analyticsTotal tests: 1125 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
{ | ||
// update the purpose from PEER_MIGRATION to PRIVATE | ||
Config: testAccComputeSubnetwork_purposeUpdate1(cnName, subnetworkName), | ||
ConfigPlanChecks: resource.ConfigPlanChecks{ | ||
PreApply: []plancheck.PlanCheck{ | ||
plancheck.ExpectResourceAction("google_compute_subnetwork.network-with-migration-purpose", plancheck.ResourceActionUpdate), | ||
}, | ||
}, | ||
}, |
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.
This test is failing with the following error message:
resource_compute_subnetwork_test.go:162: Step 2/3 error: Pre-apply plan check(s) failed:
'google_compute_subnetwork.network-with-migration-purpose' - expected Update, got action(s): [delete create]
The error message means that google_compute_subnetwork.network-with-migration-purpose
is getting recreated in step 2 (this step) instead of updated. That means an immutable field was changed in the configuration, preventing us from testing the update logic - this is exactly the kind of test issue that the ConfigPlanChecks are there to catch 🎉
Looking at your configs, I don't see any obvious changes to immutable fields. Digging a bit more, it appears that the overall Subnetwork resource is considered immutable:
immutable: true |
This means that only fields that specify a custom update_url can be updated in-place. However, it looks like a number of fields use the normal resource update URL as their "custom URL" - the Subnetwork resource is very old, so this seems like it's probably an oversight / left over from before the resource could be updated in place.
I'd recommend removing the resource-level immutability and adding immutable: true
to all immutable fields. You'll also need to set the resource-level update_url and update_verb properties. That should fix the issue.
mmv1/third_party/terraform/services/compute/resource_compute_subnetwork_test.go.tmpl
Show resolved
Hide resolved
mmv1/third_party/terraform/services/compute/resource_compute_subnetwork_test.go.tmpl
Show resolved
Hide resolved
mmv1/third_party/terraform/services/compute/resource_compute_subnetwork_test.go.tmpl
Show resolved
Hide resolved
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
2 similar comments
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 1133 Click here to see the affected service packages
Action takenFound 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
2 similar comments
Tests analyticsTotal tests: 1133 Click here to see the affected service packages
Action takenFound 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Tests analyticsTotal tests: 1133 Click here to see the affected service packages
Action takenFound 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🟢 All tests passed! |
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🟢 All tests passed! |
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🟢 All tests passed! |
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.
LGTM!
…leCloudPlatform#12922) Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
…leCloudPlatform#12922) Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
…leCloudPlatform#12922) Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
…leCloudPlatform#12922) Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
…leCloudPlatform#12922) Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
Added necessary code to make 'purpose' field updatable.
This pull request takes care of issue: hashicorp/terraform-provider-google#19937
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.