Skip to content

cloudrunv2: send 0.0 values for cpuUtilization and concurrencyUtilization to support disabling scaling signals - #18682

Open
manalikumar wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
manalikumar:cloudrun-scaling-send-empty-value
Open

cloudrunv2: send 0.0 values for cpuUtilization and concurrencyUtilization to support disabling scaling signals#18682
manalikumar wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
manalikumar:cloudrun-scaling-send-empty-value

Conversation

@manalikumar

@manalikumar manalikumar commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

When setting cpu_utilization = 0 or concurrency_utilization = 0 to disable autoscaling thresholds, Terraform was omitting the field because 0.0 is considered an empty value in Go.

Using a custom expander with raw config inspection ensures that 0.0 is explicitly sent in the request payload to the Cloud Run v2 API when configured in HCL, while unconfigured fields remain omitted so default autoscaling behavior is preserved without triggering mutual exclusion 400 errors.

Fixes b/448515376

cloudrun: fixed an issue where setting `cpu_utilization = 0` or `concurrency_utilization = 0` on `google_cloud_run_v2_service` did not disable the autoscaling signal

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 17, 2026
@github-actions

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@ScottSuarez, 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.

@github-actions
github-actions Bot requested a review from ScottSuarez August 17, 2026 20:45
@modular-magician modular-magician added service/run and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Aug 18, 2026
@modular-magician

modular-magician commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 56d3f43:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google-beta provider View Diff 2 files changed, 29 insertions(+), 2 deletions(-)
terraform-google-conversion View Diff 1 file changed, 2 insertions(+), 2 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
97 74 9 14
Affected Service Packages
  • cloudrunv2

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 14 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2MultiRegionService
  • TestAccCloudRunV2Service_cloudrunv2ServiceAttributionLabel
  • TestAccCloudRunV2Service_cloudrunv2ServiceCustomAudienceUpdate
  • TestAccCloudRunV2Service_cloudrunv2ServiceFullUpdate
  • TestAccCloudRunV2Service_cloudrunv2ServiceGRPCProbesUpdate
  • TestAccCloudRunV2Service_cloudrunv2ServiceHTTPProbesUpdate
  • TestAccCloudRunV2Service_cloudrunv2ServiceMeshUpdate
  • TestAccCloudRunV2Service_cloudrunv2ServiceScalingControlsExample
  • TestAccCloudRunV2Service_cloudrunv2ServiceTCPProbesUpdate
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithDefaultUriDisabled
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithDirectVPCUpdate
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithManualScaling
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithReadinessProbe
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceAttributionLabel
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceCustomAudienceUpdate
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceFullUpdate
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceHTTPProbesUpdate
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceScalingControlsExample
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceTCPProbesUpdate
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceWithDefaultUriDisabled
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceWithDirectVPCUpdate
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceWithManualScaling
❌ Error · Log - TestAccCloudRunV2Service_cloudrunv2MultiRegionService
❌ Error · Log - TestAccCloudRunV2Service_cloudrunv2ServiceGRPCProbesUpdate
❌ Error · Log - TestAccCloudRunV2Service_cloudrunv2ServiceMeshUpdate
❌ Error · Log - TestAccCloudRunV2Service_cloudrunv2ServiceWithReadinessProbe
❌ Error · Log - TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@manalikumar, @ian-mi, @ScottSuarez VCR tests complete for 56d3f43!

…scaling signals with 0.0

Using a custom expander with raw config inspection ensures that 0.0 is only sent when explicitly configured by the user in HCL, avoiding sending 0.0 for unconfigured fields which causes Cloud Run API 400 errors when scaling block is used without utilization targets.
@manalikumar
manalikumar force-pushed the cloudrun-scaling-send-empty-value branch from 56d3f43 to 298c7a9 Compare August 18, 2026 21:40
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests service/run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants