@@ -637,6 +637,50 @@ func TestAccContainerCluster_withILBSubsetting(t *testing.T) {
637637 })
638638}
639639
640+ func TestAccContainerCluster_omittedILBSubsetting (t * testing.T ) {
641+ t .Parallel ()
642+
643+ clusterName := fmt .Sprintf ("tf-test-cluster-%s" , acctest .RandString (t , 10 ))
644+ npName := fmt .Sprintf ("tf-test-cluster-nodepool-%s" , acctest .RandString (t , 10 ))
645+ networkName := acctest .BootstrapSharedTestNetwork (t , "gke-cluster" )
646+ subnetworkName := acctest .BootstrapSubnet (t , "gke-cluster" , networkName )
647+
648+ acctest .VcrTest (t , resource.TestCase {
649+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
650+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
651+ CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
652+ Steps : []resource.TestStep {
653+ {
654+ Config : testAccContainerCluster_omittedILBSubSetting (clusterName , npName , networkName , subnetworkName ),
655+ },
656+ {
657+ ResourceName : "google_container_cluster.confidential_nodes" ,
658+ ImportState : true ,
659+ ImportStateVerify : true ,
660+ ImportStateVerifyIgnore : []string {"deletion_protection" },
661+ },
662+ {
663+ Config : testAccContainerCluster_withILBSubSetting (clusterName , npName , networkName , subnetworkName ),
664+ },
665+ {
666+ ResourceName : "google_container_cluster.confidential_nodes" ,
667+ ImportState : true ,
668+ ImportStateVerify : true ,
669+ ImportStateVerifyIgnore : []string {"deletion_protection" },
670+ },
671+ {
672+ Config : testAccContainerCluster_omittedILBSubSetting (clusterName , npName , networkName , subnetworkName ),
673+ },
674+ {
675+ ResourceName : "google_container_cluster.confidential_nodes" ,
676+ ImportState : true ,
677+ ImportStateVerify : true ,
678+ ImportStateVerifyIgnore : []string {"deletion_protection" },
679+ },
680+ },
681+ })
682+ }
683+
640684func TestAccContainerCluster_disableL4LbFirewallReconciliation (t * testing.T ) {
641685 t .Parallel ()
642686
@@ -7320,6 +7364,33 @@ resource "google_container_cluster" "confidential_nodes" {
73207364` , clusterName , npName , networkName , subnetworkName )
73217365}
73227366
7367+ func testAccContainerCluster_omittedILBSubSetting (clusterName , npName , networkName , subnetworkName string ) string {
7368+ return fmt .Sprintf (`
7369+ resource "google_container_cluster" "confidential_nodes" {
7370+ name = "%s"
7371+ location = "us-central1-a"
7372+ release_channel {
7373+ channel = "RAPID"
7374+ }
7375+
7376+ node_pool {
7377+ name = "%s"
7378+ initial_node_count = 1
7379+ node_config {
7380+ machine_type = "e2-medium"
7381+ }
7382+ }
7383+
7384+ // enable_l4_ilb_subsetting omitted
7385+
7386+ network = "%s"
7387+ subnetwork = "%s"
7388+
7389+ deletion_protection = false
7390+ }
7391+ ` , clusterName , npName , networkName , subnetworkName )
7392+ }
7393+
73237394func testAccContainerCluster_disableILBSubSetting (clusterName , npName , networkName , subnetworkName string ) string {
73247395 return fmt .Sprintf (`
73257396resource "google_container_cluster" "confidential_nodes" {
0 commit comments