fix TestAccContainerCluster_errorCleanDanglingCluster (#3586)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2019-05-08 13:58:41 -07:00 committed by Dana Hoffman
parent 4e7471df71
commit 189a617987

View File

@ -2412,18 +2412,32 @@ resource "google_container_cluster" "with_resource_labels" {
func testAccContainerCluster_withInitialCIDR(clusterName string) string {
return fmt.Sprintf(`
resource "google_compute_network" "container_network" {
name = "container-net-%s"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "container_subnetwork" {
name = "${google_compute_network.container_network.name}"
network = "${google_compute_network.container_network.name}"
ip_cidr_range = "10.128.0.0/9"
}
resource "google_container_cluster" "cidr_error_preempt" {
name = "%s"
zone = "us-central1-a"
network = "${google_compute_network.container_network.name}"
subnetwork = "${google_compute_subnetwork.container_subnetwork.name}"
initial_node_count = 1
ip_allocation_policy {
cluster_ipv4_cidr_block = "10.3.0.0/19"
services_ipv4_cidr_block = "10.4.0.0/19"
cluster_ipv4_cidr_block = "10.0.0.0/16"
services_ipv4_cidr_block = "10.1.0.0/16"
}
}
`, clusterName)
`, clusterName, clusterName)
}
func testAccContainerCluster_withCIDROverlap(initConfig, secondCluster string) string {
@ -2434,11 +2448,14 @@ resource "google_container_cluster" "cidr_error_overlap" {
name = "%s"
zone = "us-central1-a"
network = "${google_compute_network.container_network.name}"
subnetwork = "${google_compute_subnetwork.container_subnetwork.name}"
initial_node_count = 1
ip_allocation_policy {
cluster_ipv4_cidr_block = "10.3.0.0/19"
services_ipv4_cidr_block = "10.4.0.0/19"
cluster_ipv4_cidr_block = "10.0.0.0/16"
services_ipv4_cidr_block = "10.1.0.0/16"
}
}
`, initConfig, secondCluster)