@@ -621,6 +621,50 @@ func TestAccContainerCluster_withILBSubsetting(t *testing.T) {
621621 })
622622}
623623
624+ func TestAccContainerCluster_omittedILBSubsetting(t *testing.T) {
625+ t.Parallel()
626+
627+ clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
628+ npName := fmt.Sprintf("tf-test-cluster-nodepool-%s", acctest.RandString(t, 10))
629+ networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster")
630+ subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
631+
632+ acctest.VcrTest(t, resource.TestCase{
633+ PreCheck: func() { acctest.AccTestPreCheck(t) },
634+ ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
635+ CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
636+ Steps: []resource.TestStep{
637+ {
638+ Config: testAccContainerCluster_omittedILBSubSetting(clusterName, npName, networkName, subnetworkName),
639+ },
640+ {
641+ ResourceName: "google_container_cluster.confidential_nodes",
642+ ImportState: true,
643+ ImportStateVerify: true,
644+ ImportStateVerifyIgnore: []string{"deletion_protection"},
645+ },
646+ {
647+ Config: testAccContainerCluster_withILBSubSetting(clusterName, npName, networkName, subnetworkName),
648+ },
649+ {
650+ ResourceName: "google_container_cluster.confidential_nodes",
651+ ImportState: true,
652+ ImportStateVerify: true,
653+ ImportStateVerifyIgnore: []string{"deletion_protection"},
654+ },
655+ {
656+ Config: testAccContainerCluster_omittedILBSubSetting(clusterName, npName, networkName, subnetworkName),
657+ },
658+ {
659+ ResourceName: "google_container_cluster.confidential_nodes",
660+ ImportState: true,
661+ ImportStateVerify: true,
662+ ImportStateVerifyIgnore: []string{"deletion_protection"},
663+ },
664+ },
665+ })
666+ }
667+
624668func TestAccContainerCluster_disableL4LbFirewallReconciliation(t *testing.T) {
625669 t.Parallel()
626670
@@ -7837,6 +7881,33 @@ resource "google_container_cluster" "confidential_nodes" {
78377881`, clusterName, npName, networkName, subnetworkName)
78387882}
78397883
7884+ func testAccContainerCluster_omittedILBSubSetting(clusterName, npName, networkName, subnetworkName string) string {
7885+ return fmt.Sprintf(`
7886+ resource "google_container_cluster" "confidential_nodes" {
7887+ name = "%s"
7888+ location = "us-central1-a"
7889+ release_channel {
7890+ channel = "RAPID"
7891+ }
7892+
7893+ node_pool {
7894+ name = "%s"
7895+ initial_node_count = 1
7896+ node_config {
7897+ machine_type = "e2-medium"
7898+ }
7899+ }
7900+
7901+ // enable_l4_ilb_subsetting omitted
7902+
7903+ network = "%s"
7904+ subnetwork = "%s"
7905+
7906+ deletion_protection = false
7907+ }
7908+ `, clusterName, npName, networkName, subnetworkName)
7909+ }
7910+
78407911func testAccContainerCluster_disableILBSubSetting(clusterName, npName, networkName, subnetworkName string) string {
78417912 return fmt.Sprintf(`
78427913resource "google_container_cluster" "confidential_nodes" {
0 commit comments