cloudquotas: allow ignoring multiple quota safety checks at once - #18685
Open
mfreymuth wants to merge 2 commits into
Open
cloudquotas: allow ignoring multiple quota safety checks at once #18685mfreymuth wants to merge 2 commits into
mfreymuth wants to merge 2 commits into
Conversation
added 2 commits
August 17, 2026 23:05
…ead of URL templates The ignoreSafetyChecks query parameter was interpolated directly in create_url and update_url, which only supports a single scalar value. Move its construction to pre_create/pre_update custom code so it can later support the repeated form accepted by the API. No behavior change: the parameter is now omitted when the field is unset or QUOTA_SAFETY_CHECK_UNSPECIFIED, which the API treats identically.
…deprecate ignore_safety_checks The QuotaPreferences API declares ignoreSafetyChecks as a repeated enum query parameter, but the provider modeled it as a single string. When a change trips both QUOTA_DECREASE_BELOW_USAGE and QUOTA_DECREASE_PERCENTAGE_TOO_HIGH (for example lowering a quota to 0 with recent usage), no single value works and the change cannot be applied with Terraform at all. Add ignore_safety_checks_set, a set of enum values sent as a repeated query parameter, and deprecate ignore_safety_checks. The mutual exclusion is enforced with a CustomizeDiff because ConflictsWith is not generated for url_param_only parameters. Fixes hashicorp/terraform-provider-google#19276 Fixes hashicorp/terraform-provider-google#25454
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @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. |
Author
|
The tgc unit test failure is a transient network error: terraform init got connection resets from releases.hashicorp.com while downloading providers, on tests unrelated to this change (folder_iam_member, compute_image). A re-run should clear it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes hashicorp/terraform-provider-google#19276
Fixes hashicorp/terraform-provider-google#25454
The API declares
ignoreSafetyChecksas a repeated enum query parameter, but the provider models it as a single string. When a quota change trips bothQUOTA_DECREASE_BELOW_USAGEandQUOTA_DECREASE_PERCENTAGE_TOO_HIGH(for example lowering a quota to 0 while there is recent usage), no single value is sufficient and the change cannot be applied with Terraform at all.Two commits:
ignoreSafetyChecksquery parameter inpre_create/pre_updateinstead of interpolating it in the URLs. URL templating cannot express a repeated parameter, and it must be built in exactly one place: otherwise the URL-injected default would be sent alongside the new values.ignore_safety_checks_set, sent as a repeated parameter viatransport_tpg.AddArrayQueryParams(same mechanism asaspectKeysindataplex_entry); deprecateignore_safety_checks; update the acceptance test so the quota decrease exercises both checks at once.Reviewer notes: the mutual exclusion uses a
CustomizeDiffbecauseconflictsis silently dropped forurl_param_onlyparameters (GetPropertySchemaPathonly resolves against properties). The new enum omitsQUOTA_SAFETY_CHECK_UNSPECIFIEDper the field-reference guidance, and I am open to a different field name.Release Note Template for Downstream PRs (will be copied)