@@ -5206,40 +5206,6 @@ func TestAccContainerCluster_withDNSConfig(t *testing.T) {
5206
5206
})
5207
5207
}
5208
5208
5209
- func TestAccContainerCluster_withDNSConfigWithUnspecifiedScope(t *testing.T) {
5210
- t.Parallel()
5211
-
5212
- clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
5213
- domainName := fmt.Sprintf("tf-test-domain-%s", acctest.RandString(t, 10))
5214
- networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster")
5215
- subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
5216
- acctest.VcrTest(t, resource.TestCase{
5217
- PreCheck: func() { acctest.AccTestPreCheck(t) },
5218
- ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
5219
- CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
5220
- Steps: []resource.TestStep{
5221
- {
5222
- Config: testAccContainerCluster_basic(clusterName, networkName, subnetworkName),
5223
- },
5224
- {
5225
- ResourceName: "google_container_cluster.primary",
5226
- ImportState: true,
5227
- ImportStateVerify: true,
5228
- ImportStateVerifyIgnore: []string{"deletion_protection"},
5229
- },
5230
- {
5231
- Config: testAccContainerCluster_withDNSConfig(clusterName, "CLOUD_DNS", domainName, "DNS_SCOPE_UNSPECIFIED", networkName, subnetworkName),
5232
- },
5233
- {
5234
- ResourceName: "google_container_cluster.primary",
5235
- ImportState: true,
5236
- ImportStateVerify: true,
5237
- ImportStateVerifyIgnore: []string{"deletion_protection"},
5238
- },
5239
- },
5240
- })
5241
- }
5242
-
5243
5209
func TestAccContainerCluster_withGatewayApiConfig(t *testing.T) {
5244
5210
t.Parallel()
5245
5211
clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
@@ -6099,7 +6065,21 @@ func TestAccContainerCluster_cloudDns_nil_scope(t *testing.T) {
6099
6065
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
6100
6066
Steps: []resource.TestStep{
6101
6067
{
6102
- Config: testAccContainerCluster_withAdvancedDNSConfig(clusterName, false, true, true, false, ""),
6068
+ Config: testAccContainerCluster_withDNSConfigWithoutScope(clusterName),
6069
+ },
6070
+ {
6071
+ ResourceName: "google_container_cluster.primary",
6072
+ ImportState: true,
6073
+ ImportStateVerify: true,
6074
+ ImportStateVerifyIgnore: []string{"deletion_protection"},
6075
+ },
6076
+ {
6077
+ Config: testAccContainerCluster_withDNSConfigWithUnspecifiedScope(clusterName),
6078
+ ConfigPlanChecks: resource.ConfigPlanChecks{
6079
+ PreApply: []plancheck.PlanCheck{
6080
+ plancheck.ExpectResourceAction("google_container_cluster.primary", plancheck.ResourceActionNoop),
6081
+ },
6082
+ },
6103
6083
},
6104
6084
{
6105
6085
ResourceName: "google_container_cluster.primary",
@@ -6111,6 +6091,37 @@ func TestAccContainerCluster_cloudDns_nil_scope(t *testing.T) {
6111
6091
})
6112
6092
}
6113
6093
6094
+ func testAccContainerCluster_withDNSConfigWithoutScope(clusterName string) string {
6095
+ return fmt.Sprintf(`
6096
+ resource "google_container_cluster" "primary" {
6097
+ name = "%s"
6098
+ location = "us-central1-a"
6099
+ initial_node_count = 2
6100
+ dns_config {
6101
+ cluster_dns = "CLOUD_DNS"
6102
+ }
6103
+
6104
+ deletion_protection = false
6105
+ }
6106
+ `, clusterName)
6107
+ }
6108
+
6109
+ func testAccContainerCluster_withDNSConfigWithUnspecifiedScope(clusterName string) string {
6110
+ return fmt.Sprintf(`
6111
+ resource "google_container_cluster" "primary" {
6112
+ name = "%s"
6113
+ location = "us-central1-a"
6114
+ initial_node_count = 2
6115
+ dns_config {
6116
+ cluster_dns = "CLOUD_DNS"
6117
+ cluster_dns_scope = "DNS_SCOPE_UNSPECIFIED"
6118
+ }
6119
+
6120
+ deletion_protection = false
6121
+ }
6122
+ `, clusterName)
6123
+ }
6124
+
6114
6125
func TestAccContainerCluster_autopilot_withAdditiveVPCMutation(t *testing.T) {
6115
6126
t.Parallel()
6116
6127
0 commit comments