Skip to content

cloudrunv2: permadiff fix - set template.scaling.maxInstanceCount to default_from_api: true - #18394

Merged
BBBmau merged 4 commits into
GoogleCloudPlatform:mainfrom
BBBmau:cloud-run-service-maxInstanceCount-default
Aug 4, 2026
Merged

BBBmau merged 4 commits into
GoogleCloudPlatform:mainfrom
BBBmau:cloud-run-service-maxInstanceCount-default

Conversation

@BBBmau

@BBBmau BBBmau commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Part of hashicorp/terraform-provider-google#20399
reimplementing of #14971

Initially this wasn't merged due to some uncertainties surrounding the expected values that could be set by the API for maxInstanceCount. Though from looking through past PRs we get the following on how values are calculated for maxinstanceCount:

PR Comment:

Cloud Run has a dynamic default max instances, based on the user's available quota in the region and specified instance size which makes doing accurate checks in the client rather difficult. Is there a downside to leaving this as it is and letting the server validate it?

Given that the docs contains the mention that if not set it will default to what the server determines is the appropriate value, this PR makes sense to include since the current behavior does not match what the documentation is stating:

If absent, Cloud Run will calculate a default value based on the project's available container instances quota in the region and specified instance size.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

cloudrunv2: set `template.scaling.maxInstanceCount` to `Computed` in `google_cloud_run_v2_service` resource

@modular-magician

modular-magician commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 1 file changed, 1 insertion(+)
google-beta provider View Diff 1 file changed, 1 insertion(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_cloud_run_v2_service (79 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_cloud_run_v2_service" "primary" {
  template {
    scaling {
      max_instance_count = # value needed
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
92 83 9 0
Affected Service Packages
  • cloudrunv2

Learn how VCR tests work


Step 1: Replaying Mode

🟢 All tests passed in Replaying mode! No Recording was needed.

View the replaying VCR build log

@BBBmau, @melinath, @ian-mi VCR tests complete for 6aedba3!

@modular-magician
modular-magician requested a review from ian-mi July 24, 2026 21:12
@melinath melinath changed the title cloudrunv2: permadiff fix - set template.scaling.maxInstanceCount to default_value: true cloudrunv2: permadiff fix - set template.scaling.maxInstanceCount to default_from_api: true Jul 28, 2026

@melinath melinath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, though the release note should focus more on the user impact & not mention mmv1-specific terminology.

Normally I wouldn't care about the missing test, but given this fixes a regression, is there a test that was previously displaying this failure which is now fine? I don't see one... Not necessarily a blocker, but would be nice to have.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

This PR is approved and has been waiting for merge for 1 week. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.

@modular-magician

modular-magician commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 55 insertions(+)
google-beta provider View Diff 2 files changed, 55 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
95 85 9 1
Affected Service Packages
  • cloudrunv2

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

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

Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2ServiceMaxInstanceCountNoPermadiff

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccCloudRunV2Service_cloudrunv2ServiceMaxInstanceCountNoPermadiff

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.

@BBBmau, @ian-mi VCR tests complete for d3a5fb4!

@modular-magician

modular-magician commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 53 insertions(+)
google-beta provider View Diff 2 files changed, 53 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
95 85 9 1
Affected Service Packages
  • cloudrunv2

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

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

Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2ServiceMaxInstanceCountNoPermadiff

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccCloudRunV2Service_cloudrunv2ServiceMaxInstanceCountNoPermadiff

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.

@BBBmau, @ian-mi VCR tests complete for 0115533!

@modular-magician

modular-magician commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 50 insertions(+)
google-beta provider View Diff 2 files changed, 50 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
95 85 9 1
Affected Service Packages
  • cloudrunv2

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

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

Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2ServiceMaxInstanceCountNoPermadiff

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccCloudRunV2Service_cloudrunv2ServiceMaxInstanceCountNoPermadiff

🟢 All tests passed!

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

@BBBmau, @ian-mi VCR tests complete for d807962!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants