-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Validate that subnetwork_project
should match with the project in subnetwork
field in google_compute_instance
resource
#11537
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
Validate that subnetwork_project
should match with the project in subnetwork
field in google_compute_instance
resource
#11537
Conversation
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @zli82016, 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. |
/gcbrun |
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.
|
that unit-test fail doesn't seem related |
Throwing an error is a good idea to let the user know that the provided subnetwork_project is not correct. |
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.
Can you please add the validation? Thanks.
This isn't really a simple field validation to use ValidateFunc because it depends on an external value which isn't really supported by the types used in ValidateFunc, StateFunc or DiffSuppressFunc. |
/gcbrun |
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: 3921 Click here to see the affected service packages
Tests were added that are skipped in VCR:
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
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: 3923 Click here to see the affected service packages
Tests were added that are skipped in VCR:
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 due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made. Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer. |
Got the same test fails in 2 other PR's. Don't think they are related. |
google_compute_instance
to reflect the correct behaviour of subnetwork_project
fieldsubnetwork_project
should match with the project in subnetwork
field in google_compute_instance
resource
Thank you for adding the validation. Do you mind adding an acceptance test to check if the incorrect configuration for subnetwork_project will return error in https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/services/compute/resource_compute_instance_test.go.erb? |
Done |
/gcbrun |
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: 3934 Click here to see the affected service packages
Tests were added that are skipped in VCR:
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 due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made. Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer. |
@zli82016 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @zli82016 This PR has been waiting for review for 1 week. Please take a look! Use the label |
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. Thanks for adding the validation. The failed tests are unrelated.
…subnetwork` field in `google_compute_instance` resource (GoogleCloudPlatform#11537)
…subnetwork` field in `google_compute_instance` resource (GoogleCloudPlatform#11537)
closes hashicorp/terraform-provider-google#15749
The
subnetwork_project
field is ignored in the API request when a self_link is given insubnetwork
, but not in terraform which is correct behavior becausesubnetwork_project
is still in the code. Suppressing a diff on this seems unreasonable because providing something like this isn't really a valid configMaybe throw an error when this happens?
Release Note Template for Downstream PRs (will be copied)