@@ -812,7 +812,7 @@ func TestAccContainerCluster_regionalWithNodeLocations(t *testing.T) {
812
812
})
813
813
}
814
814
815
- func TestAccContainerCluster_withPrivateClusterConfig (t * testing.T ) {
815
+ func TestAccContainerCluster_withPrivateClusterConfigBasic (t * testing.T ) {
816
816
t .Parallel ()
817
817
818
818
clusterName := fmt .Sprintf ("tf-test-cluster-%s" , randString (t , 10 ))
@@ -824,7 +824,15 @@ func TestAccContainerCluster_withPrivateClusterConfig(t *testing.T) {
824
824
CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
825
825
Steps : []resource.TestStep {
826
826
{
827
- Config : testAccContainerCluster_withPrivateClusterConfig (containerNetName , clusterName ),
827
+ Config : testAccContainerCluster_withPrivateClusterConfig (containerNetName , clusterName , false ),
828
+ },
829
+ {
830
+ ResourceName : "google_container_cluster.with_private_cluster" ,
831
+ ImportState : true ,
832
+ ImportStateVerify : true ,
833
+ },
834
+ {
835
+ Config : testAccContainerCluster_withPrivateClusterConfig (containerNetName , clusterName , true ),
828
836
},
829
837
{
830
838
ResourceName : "google_container_cluster.with_private_cluster" ,
@@ -5484,7 +5492,7 @@ resource "google_container_cluster" "with_private_cluster" {
5484
5492
` , containerNetName , clusterName , location , autopilotEnabled )
5485
5493
}
5486
5494
5487
- func testAccContainerCluster_withPrivateClusterConfig (containerNetName string , clusterName string ) string {
5495
+ func testAccContainerCluster_withPrivateClusterConfig (containerNetName string , clusterName string , masterGlobalAccessEnabled bool ) string {
5488
5496
return fmt .Sprintf (`
5489
5497
resource "google_compute_network" "container_network" {
5490
5498
name = "%s"
@@ -5526,7 +5534,7 @@ resource "google_container_cluster" "with_private_cluster" {
5526
5534
enable_private_nodes = true
5527
5535
master_ipv4_cidr_block = "10.42.0.0/28"
5528
5536
master_global_access_config {
5529
- enabled = true
5537
+ enabled = %t
5530
5538
}
5531
5539
}
5532
5540
master_authorized_networks_config {
@@ -5536,7 +5544,7 @@ resource "google_container_cluster" "with_private_cluster" {
5536
5544
services_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[1].range_name
5537
5545
}
5538
5546
}
5539
- ` , containerNetName , clusterName )
5547
+ ` , containerNetName , clusterName , masterGlobalAccessEnabled )
5540
5548
}
5541
5549
5542
5550
func testAccContainerCluster_withShieldedNodes (clusterName string , enabled bool ) string {
0 commit comments