@@ -1618,34 +1618,6 @@ func expandNodeConfig(d tpgresource.TerraformResourceData, prefix string, v inte
16181618
16191619 if v , ok := nodeConfig ["kubelet_config" ]; ok {
16201620 nc .KubeletConfig = expandKubeletConfig (v )
1621-
1622- // // start cpu_cfs_quota fix https://github.com/hashicorp/terraform-provider-google/issues/15767
1623- // // this makes the field conditional on appearance in configuration. This allows the API `true` default
1624- // // to override null, where currently we force-send null as false, which is wrong.
1625- // rawConfigNPRoot := d.GetRawConfig()
1626- // // if we have a prefix, we're in `node_pool.N.` in GKE Cluster. Traverse the RawConfig object to reach that
1627- // // root, at which point local references work going forwards.
1628- // if prefix != "" {
1629- // parts := strings.Split(prefix, ".") // "node_pool.N." -> ["node_pool" "N", ""]
1630- // npIndex, err := strconv.Atoi(parts[1])
1631- // if err != nil { // no error return from expander
1632- // panic(fmt.Errorf("unexpected format for node pool path prefix: %w. value: %v", err, prefix))
1633- // }
1634-
1635- // rawConfigNPRoot = rawConfigNPRoot.GetAttr("node_pool").Index(cty.NumberIntVal(int64(npIndex)))
1636- // }
1637-
1638- // if vNC := rawConfigNPRoot.GetAttr("node_config"); vNC.LengthInt() > 0 {
1639- // if vKC := vNC.Index(cty.NumberIntVal(0)).GetAttr("kubelet_config"); vKC.LengthInt() > 0 {
1640- // v := vKC.Index(cty.NumberIntVal(0)).GetAttr("cpu_cfs_quota")
1641- // if v == cty.NullVal(cty.Bool) {
1642- // nc.KubeletConfig.CpuCfsQuota = true
1643- // } else if v.False() { // force-send explicit false to API
1644- // nc.KubeletConfig.ForceSendFields = append(nc.KubeletConfig.ForceSendFields, "CpuCfsQuota")
1645- // }
1646- // }
1647- // }
1648- // end cpu_cfs_quota fix
16491621 }
16501622
16511623 if v , ok := nodeConfig ["linux_node_config" ]; ok {
@@ -2377,16 +2349,6 @@ func flattenNodeConfig(c *container.NodeConfig, v interface{}) []map[string]inte
23772349 return config
23782350 }
23792351
2380- // default to no prior taint state if there are any issues
2381- oldTaints := []interface {}{}
2382- oldNodeConfigSchemaContainer := v .([]interface {})
2383- if len (oldNodeConfigSchemaContainer ) != 0 {
2384- oldNodeConfigSchema := oldNodeConfigSchemaContainer [0 ].(map [string ]interface {})
2385- if vt , ok := oldNodeConfigSchema ["taint" ]; ok && len (vt .([]interface {})) > 0 {
2386- oldTaints = vt .([]interface {})
2387- }
2388- }
2389-
23902352 config = append (config , map [string ]interface {}{
23912353 "machine_type" : c .MachineType ,
23922354 "containerd_config" : flattenContainerdConfig (c .ContainerdConfig ),
@@ -2413,8 +2375,7 @@ func flattenNodeConfig(c *container.NodeConfig, v interface{}) []map[string]inte
24132375 "spot" : c .Spot ,
24142376 "min_cpu_platform" : c .MinCpuPlatform ,
24152377 "shielded_instance_config" : flattenShieldedInstanceConfig (c .ShieldedInstanceConfig ),
2416- "taint" : flattenTaints (c .Taints , oldTaints ),
2417- "effective_taints" : flattenEffectiveTaints (c .Taints ),
2378+ "taint" : flattenEffectiveTaints (c .Taints ),
24182379 "workload_metadata_config" : flattenWorkloadMetadataConfig (c .WorkloadMetadataConfig ),
24192380 "confidential_nodes" : flattenConfidentialNodes (c .ConfidentialNodes ),
24202381 "boot_disk_kms_key" : c .BootDiskKmsKey ,
0 commit comments