Skip to content

Fix ContainerNodePool defaulting cpu_cfs_quota to false in TGC/KCC - #18824

Open
cdmello-g wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
cdmello-g:fix-kcc-cpu-cfs-quota
Open

Fix ContainerNodePool defaulting cpu_cfs_quota to false in TGC/KCC#18824
cdmello-g wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
cdmello-g:fix-kcc-cpu-cfs-quota

Conversation

@cdmello-g

@cdmello-g cdmello-g commented Aug 28, 2026

Copy link
Copy Markdown

Description

When kubeletConfig is defined on a GKE node pool in Config Connector (KCC) or terraform_google_conversion (TGC) without explicitly setting cpuCfsQuota, the field was evaluated to false because Terraform Plugin SDK maps populate the Go zero-value (false) for omitted boolean fields. This caused TGC/KCC to force-send cpuCfsQuota: false to the GKE Cluster Manager API.

PR #15268 fixed this for the standalone Terraform CLI provider by inspecting d.GetRawConfig(), but this logic was omitted from tgc_next, leaving KCC vulnerable to the bug.

Changes

Ports the cpu_cfs_quota raw configuration check from node_config.go.tmpl into tgc_next/pkg/services/container/node_config.go (expandNodeConfig) so that:

  • When omitted or null, nc.KubeletConfig.CpuCfsQuota is explicitly set to true (matching native GKE behavior).
  • When explicitly set to false, CpuCfsQuota is appended to ForceSendFields.

Fixes hashicorp/terraform-provider-google#15767
Ref b/553981933, b/300067081, b/395145072

container: fixed an issue where omitting `cpu_cfs_quota` in `kubelet_config` defaulted to `false` in `terraform-google-conversion` (TGC) / Config Connector

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 28, 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 28, 2026 16:06
When kubeletConfig is defined on a GKE node pool in Config Connector (KCC)
or terraform_google_conversion (TGC) without explicitly setting cpuCfsQuota,
the boolean field defaulted to false, causing KCC to force-send cpuCfsQuota: false
to the GKE Cluster Manager API.

PR GoogleCloudPlatform#15268 fixed this for the standalone Terraform provider using raw config inspection,
but this logic was omitted from TGC (tgc_next), leaving KCC vulnerable to the bug.

This change ports the cpu_cfs_quota raw configuration check to tgc_next expandNodeConfig
so that explicit false values are preserved via ForceSendFields while unset/null evaluates to true.

Fixes hashicorp/terraform-provider-google#15767
Ref b/553981933, b/300067081, b/395145072
@cdmello-g
cdmello-g force-pushed the fix-kcc-cpu-cfs-quota branch from 4a50a5f to ce848d1 Compare August 28, 2026 16:16
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

container_cluster.node_config.kubelet_config.cpu_cfs_quota value is set in cluster request even when no value is set in config

2 participants