mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
fix TestAccContainerCluster_errorCleanDanglingCluster (#3586)
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
4e7471df71
commit
189a617987
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user