@@ -1536,6 +1536,49 @@ func TestAccContainerCluster_withNodeConfig(t *testing.T) {
1536
1536
})
1537
1537
}
1538
1538
1539
+ func TestAccContainerCluster_withNodeConfigGcfsConfig(t *testing.T) {
1540
+ t.Parallel()
1541
+ clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
1542
+ networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster")
1543
+ subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
1544
+
1545
+ acctest.VcrTest(t, resource.TestCase{
1546
+ PreCheck: func() { acctest.AccTestPreCheck(t) },
1547
+ ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
1548
+ CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
1549
+ Steps: []resource.TestStep{
1550
+ {
1551
+ Config: testAccContainerCluster_withNodeConfigGcfsConfig(clusterName, networkName, subnetworkName, false),
1552
+ ConfigPlanChecks: resource.ConfigPlanChecks{
1553
+ PreApply: []plancheck.PlanCheck{
1554
+ acctest.ExpectNoDelete(),
1555
+ },
1556
+ },
1557
+ },
1558
+ {
1559
+ ResourceName: "google_container_cluster.with_node_config_gcfs_config",
1560
+ ImportState: true,
1561
+ ImportStateVerify: true,
1562
+ ImportStateVerifyIgnore: []string{"deletion_protection"},
1563
+ },
1564
+ {
1565
+ Config: testAccContainerCluster_withNodeConfigGcfsConfig(clusterName, networkName, subnetworkName, true),
1566
+ ConfigPlanChecks: resource.ConfigPlanChecks{
1567
+ PreApply: []plancheck.PlanCheck{
1568
+ acctest.ExpectNoDelete(),
1569
+ },
1570
+ },
1571
+ },
1572
+ {
1573
+ ResourceName: "google_container_cluster.with_node_config_gcfs_config",
1574
+ ImportState: true,
1575
+ ImportStateVerify: true,
1576
+ ImportStateVerifyIgnore: []string{"deletion_protection"},
1577
+ },
1578
+ },
1579
+ })
1580
+ }
1581
+
1539
1582
// Note: Updates for these are currently known to be broken (b/361634104), and
1540
1583
// so are not tested here.
1541
1584
// They can probably be made similar to, or consolidated with,
@@ -6693,6 +6736,26 @@ resource "google_container_cluster" "with_node_config" {
6693
6736
`, clusterName, networkName, subnetworkName)
6694
6737
}
6695
6738
6739
+ func testAccContainerCluster_withNodeConfigGcfsConfig(clusterName, networkName, subnetworkName string, enabled bool) string {
6740
+ return fmt.Sprintf(`
6741
+ resource "google_container_cluster" "with_node_config_gcfs_config" {
6742
+ name = "%s"
6743
+ location = "us-central1-f"
6744
+ initial_node_count = 1
6745
+
6746
+ node_config {
6747
+ gcfs_config {
6748
+ enabled = %t
6749
+ }
6750
+ }
6751
+
6752
+ deletion_protection = false
6753
+ network = "%s"
6754
+ subnetwork = "%s"
6755
+ }
6756
+ `, clusterName, enabled, networkName, subnetworkName)
6757
+ }
6758
+
6696
6759
func testAccContainerCluster_withNodeConfigKubeletConfigSettings(clusterName, networkName, subnetworkName string) string {
6697
6760
return fmt.Sprintf(`
6698
6761
resource "google_container_cluster" "with_node_config_kubelet_config_settings" {
0 commit comments