@@ -95,6 +95,39 @@ func TestAccContainerCluster_basic(t *testing.T) {
9595 })
9696}
9797
98+ // This is to ensure that updates don't get trigerred with incorrect interpration of
99+ // nil serviceAccount keys as empty array.
100+ func TestAccContainerCluster_basic_noCpaUpgrade (t * testing.T ) {
101+ t .Parallel ()
102+
103+ clusterName := fmt .Sprintf ("tf-test-cluster-%s" , acctest .RandString (t , 10 ))
104+ networkName := acctest .BootstrapSharedTestNetwork (t , "gke-cluster" )
105+ subnetworkName := acctest .BootstrapSubnet (t , "gke-cluster" , networkName )
106+ acctest .VcrTest (t , resource.TestCase {
107+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
108+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
109+ CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
110+ Steps : []resource.TestStep {
111+ {
112+ Config : testAccContainerCluster_basic (clusterName , networkName , subnetworkName ),
113+ Check : resource .ComposeAggregateTestCheckFunc (
114+ resource .TestCheckResourceAttrSet ("google_container_cluster.primary" , "services_ipv4_cidr" ),
115+ resource .TestCheckResourceAttrSet ("google_container_cluster.primary" , "self_link" ),
116+ resource .TestCheckResourceAttr ("google_container_cluster.primary" , "networking_mode" , "VPC_NATIVE" ),
117+ ),
118+ },
119+ {
120+ Config : testAccContainerCluster_basic (clusterName , networkName , subnetworkName ),
121+ ConfigPlanChecks : resource.ConfigPlanChecks {
122+ PreApply : []plancheck.PlanCheck {
123+ plancheck .ExpectResourceAction ("google_container_cluster.primary" , plancheck .ResourceActionNoop ),
124+ },
125+ },
126+ },
127+ },
128+ })
129+ }
130+
98131func TestAccContainerCluster_resourceManagerTags (t * testing.T ) {
99132 t .Parallel ()
100133
0 commit comments