-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Resolve persistent diff on WorkerPool scaling_mode #16061
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
base: main
Are you sure you want to change the base?
Resolve persistent diff on WorkerPool scaling_mode #16061
Conversation
kminsu-google
commented
Jan 3, 2026
…as the field is not applicable to the resource.
The `google_cloud_run_v2_worker_pool` resource showed a perpetual diff on the `scaling.scaling_mode` field. When the `scaling` block was configured (e.g., with `manual_instance_count`) but `scaling_mode` was omitted, Terraform would try to remove the `scaling_mode` attribute on subsequent plans. This occurred because the Cloud Run API defaults `scaling_mode` to "MANUAL" if not specified, but the Terraform resource schema did not account for this server-side default. This commit adds `default_from_api: true` to the `scaling.scaling_mode` field in the magic-modules YAML definition. This informs the provider that the API may return a default value for this field, preventing Terraform from detecting a diff when the API provides the "MANUAL" value that isn't explicitly in the configuration.
|
Hello! I am a robot. Tests will require approval from a repository maintainer to run. Googlers: For automatic test runs see go/terraform-auto-test-runs. @hao-nan-li, 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. |
|
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.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_cloud_run_v2_worker_pool" "primary" {
scaling {
scaling_mode = # value needed
}
}
|
Tests analyticsTotal tests: 85 Click here to see the affected service packages
🟢 All tests passed! View the build log |
hao-nan-li
left a comment
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.
Could you attach the bug ID this PR tries to fix?
| type: Enum | ||
| description: | | ||
| The scaling mode for the worker pool. It defaults to MANUAL. | ||
| default_from_api: true |
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.
Is there a test that covers what you'd like to fix?
If not could you add one?
|
@kminsu-google, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. This notification can be disabled with the |
