Skip to content

Commit cf45c74

Browse files
committed
Update test
1 parent 536cc21 commit cf45c74

File tree

1 file changed

+46
-35
lines changed

1 file changed

+46
-35
lines changed

mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.tmpl

+46-35
Original file line numberDiff line numberDiff line change
@@ -5206,40 +5206,6 @@ func TestAccContainerCluster_withDNSConfig(t *testing.T) {
52065206
})
52075207
}
52085208

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-
52435209
func TestAccContainerCluster_withGatewayApiConfig(t *testing.T) {
52445210
t.Parallel()
52455211
clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
@@ -6099,7 +6065,21 @@ func TestAccContainerCluster_cloudDns_nil_scope(t *testing.T) {
60996065
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
61006066
Steps: []resource.TestStep{
61016067
{
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+
},
61036083
},
61046084
{
61056085
ResourceName: "google_container_cluster.primary",
@@ -6111,6 +6091,37 @@ func TestAccContainerCluster_cloudDns_nil_scope(t *testing.T) {
61116091
})
61126092
}
61136093

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+
61146125
func TestAccContainerCluster_autopilot_withAdditiveVPCMutation(t *testing.T) {
61156126
t.Parallel()
61166127

0 commit comments

Comments
 (0)