Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,10 @@ func TestUnitFlattenClusterNodePools(t *testing.T) {
Optional: true,
Elem: &schema.Resource{Schema: map[string]*schema.Schema{"create_pod_range": {Type: schema.TypeBool}}},
},
"ignore_node_count_changes": {
Type: schema.TypeBool,
Optional: true,
},
},
},
Optional: true,
Expand Down Expand Up @@ -701,6 +705,7 @@ func TestUnitFlattenClusterNodePools(t *testing.T) {
"managed_instance_group_urls": []string{},
"version": "",
"network_config": []map[string]interface{}{},
"ignore_node_count_changes": false,
},
{
"name": "pool-2",
Expand All @@ -713,6 +718,7 @@ func TestUnitFlattenClusterNodePools(t *testing.T) {
"managed_instance_group_urls": []string{},
"version": "",
"network_config": []map[string]interface{}{},
"ignore_node_count_changes": false,
},
},
expectError: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,9 @@ func TestAccContainerCluster_regionalWithNodePool(t *testing.T) {
ResourceName: "google_container_cluster.regional",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"deletion_protection", "ignore_node_count_changes", "node_pool.0.ignore_node_count_changes"},
// Virtual fields like ignore_node_count_changes are not loaded on import. When import runs with default
// false for ignore_node_count_changes, managed_instance_group_urls is populated from the API, causing an import diff.
ImportStateVerifyIgnore: []string{"deletion_protection", "ignore_node_count_changes", "node_pool.0.ignore_node_count_changes", "node_pool.0.managed_instance_group_urls"},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,8 @@ func flattenNodePool(d *schema.ResourceData, config *transport_tpg.Config, np *c
"instance_group_urls": igmUrls,
"managed_instance_group_urls": managedIgmUrls,
"version": np.Version,
"network_config": flattenNodeNetworkConfig(np.NetworkConfig, d, prefix),
"network_config": flattenNodeNetworkConfig(np.NetworkConfig, d, prefix),
"ignore_node_count_changes": d.Get(prefix + "ignore_node_count_changes"),
}

if np.Autoscaling != nil {
Expand Down