-
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
Correct SecurityGateway to be global only #12788
base: main
Are you sure you want to change the base?
Correct SecurityGateway to be global only #12788
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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. |
@melinath Is it reasonable to add the |
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.
I don't think we should roll this back, since it would break folks who start using this resource using v6.16.0. To put it in terms of our policies, in minor releases we only allow breaking changes that impact all valid configurations. However, in this case, setting location to "global" works, and removing the field would break that configuration.
Instead, I would suggest changing the field from required to optional and setting a default_value of global
.
If the field is expected to continue only supporting global indefinitely, you could also add client-side validation to ensure that it is set to "global". Otherwise, you could document that it only allows "global" or link to c.g.c documentation that lists the allowed values.
'global' as default
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.
Breaking Change(s) DetectedThe following breaking change(s) were detected within your pull request.
If you believe this detection to be incorrect please raise the concern with your reviewer. Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_beyondcorp_security_gateway" "primary" {
location = # value needed
}
|
Tests analyticsTotal tests: 20 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.
LGTM - breaking change is fine since using values other than global wouldn't work.
By the way, if you want to remove this field, you can do so in the next major release (which will have a contribution window this summer).
Before submitting, I want to test these changes will work with the IAM policy i'm adding in #12782. Is it ok to change the import_format for the IAM policy to only have "global"? In our case, only the global location supports IAM. |
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.
Breaking Change(s) DetectedThe following breaking change(s) were detected within your pull request.
If you believe this detection to be incorrect please raise the concern with your reviewer. Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_beyondcorp_security_gateway" "primary" {
location = # value needed
}
|
Tests analyticsTotal tests: 20 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.
I think you will need to change the URL definitions to all use locations/global
instead of locations/{{location}}
- that should prevent the location field from being added to the IAM resource, because of how the generation of IAM code works (but it would probably be worth double-checking that it actually works before we merge this.)
If you ever expect to support non-global locations it's probably best to just leave this as is.
If you never expect to support non-global locations, it would probably be good to mark the location field as deprecated for extra clarity.
If I change all url defs (IAM policy and all outside of it) then it works and doesn't add the locations field. I'll add the deprecation warning since we don't ever plan to have these as global resources. Since the tests will fail if the location is not 'global', is there a way to limit the VCR tests in the PR to only use the global location? Is that through the test_env_vars field in |
The tests in this PR are already using the global location; the tests in the IAM PR should also use the global location once the location field no longer exists. |
I'm seeing that the test projects in the IAM PR run out of quota since there is a limit of 1 resource per project. Is there a list of projects that we can increase the quota for? |
Change is for correcting a mistake in the original submission from last week: #12695