Skip to content

Commit 7a11f3d

Browse files
authored
container: allow updating storage_pools (#13657)
Signed-off-by: drfaust92 <[email protected]>
1 parent b103d8f commit 7a11f3d

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

mmv1/third_party/terraform/services/container/node_config.go.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ func schemaNodeConfig() *schema.Schema {
470470

471471
"storage_pools": {
472472
Type: schema.TypeList,
473-
ForceNew: true,
474473
Optional: true,
475474
Elem: &schema.Schema{Type: schema.TypeString},
476475
Description: `The list of Storage Pools where boot disks are provisioned.`,

mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.tmpl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13358,6 +13358,18 @@ func TestAccContainerCluster_storagePoolsWithNodeConfig(t *testing.T) {
1335813358
ImportStateVerify: true,
1335913359
ImportStateVerifyIgnore: []string{"deletion_protection"},
1336013360
},
13361+
{
13362+
Config: testAccContainerCluster_storagePoolsWithNodeConfigUpdate(cluster, location, networkName, subnetworkName),
13363+
Check: resource.ComposeTestCheckFunc(
13364+
resource.TestCheckResourceAttr("google_container_cluster.storage_pools_with_node_config", "node_config.0.storage_pools.#", "0"),
13365+
),
13366+
},
13367+
{
13368+
ResourceName: "google_container_cluster.storage_pools_with_node_config",
13369+
ImportState: true,
13370+
ImportStateVerify: true,
13371+
ImportStateVerifyIgnore: []string{"deletion_protection"},
13372+
},
1336113373
},
1336213374
})
1336313375
}
@@ -13384,6 +13396,27 @@ resource "google_container_cluster" "storage_pools_with_node_config" {
1338413396
`, cluster, location, storagePoolResourceName, networkName, subnetworkName)
1338513397
}
1338613398

13399+
func testAccContainerCluster_storagePoolsWithNodeConfigUpdate(cluster, location, networkName, subnetworkName string) string {
13400+
return fmt.Sprintf(`
13401+
resource "google_container_cluster" "storage_pools_with_node_config" {
13402+
name = "%s"
13403+
location = "%s"
13404+
13405+
initial_node_count = 1
13406+
node_config {
13407+
machine_type = "c3-standard-4"
13408+
image_type = "COS_CONTAINERD"
13409+
disk_type = "hyperdisk-balanced"
13410+
}
13411+
13412+
network = "%s"
13413+
subnetwork = "%s"
13414+
13415+
deletion_protection = false
13416+
}
13417+
`, cluster, location, networkName, subnetworkName)
13418+
}
13419+
1338713420
func TestAccContainerCluster_withAutopilotGcpFilestoreCsiDriver(t *testing.T) {
1338813421
t.Parallel()
1338913422

0 commit comments

Comments
 (0)