Skip to content

Commit 4ba613b

Browse files
committed
Add random suffix to end of cluster names during testing
1 parent 218e1b9 commit 4ba613b

File tree

18 files changed

+43
-8
lines changed

18 files changed

+43
-8
lines changed

examples/deploy_service/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ data "google_client_config" "default" {}
3535
module "gke" {
3636
source = "../../"
3737
project_id = "${var.project_id}"
38-
name = "${local.cluster_type}-cluster"
38+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3939
region = "${var.region}"
4040
network = "${var.network}"
41-
subnetwork = "${var.subnetwork}"
42-
ip_range_pods = "${var.ip_range_pods}"
41+
subnetwork = "${var.subnetwork}" ip_range_pods = "${var.ip_range_pods}"
4342
ip_range_services = "${var.ip_range_services}"
4443
kubernetes_version = "1.11.5-gke.4"
4544
service_account = "${var.compute_engine_service_account}"

examples/deploy_service/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
region = "${var.region}"
3131
network = "${var.network}"
3232
subnetwork = "${var.subnetwork}"

examples/node_pool/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/shared_vpc/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
region = "${var.region}"
3131
network = "${var.network}"
3232
network_project_id = "${var.network_project_id}"

examples/shared_vpc/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/simple_regional/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
regional = true
3131
region = "${var.region}"
3232
network = "${var.network}"

examples/simple_regional/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/simple_zonal/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
regional = false
3131
region = "${var.region}"
3232
zones = "${var.zones}"

examples/simple_zonal/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/stub_domains/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
region = "${var.region}"
3131
network = "${var.network}"
3232
subnetwork = "${var.subnetwork}"

examples/stub_domains/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

test/fixtures/deploy_service/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
subnetwork = "${google_compute_subnetwork.main.name}"

test/fixtures/node_pool/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
subnetwork = "${google_compute_subnetwork.main.name}"

test/fixtures/shared_vpc/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
network_project_id = "${var.project_id}"

test/fixtures/simple_regional/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
subnetwork = "${google_compute_subnetwork.main.name}"

test/fixtures/simple_zonal/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
zones = ["${var.zones}"]
2425
network = "${google_compute_network.main.name}"

test/fixtures/stub_domains/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
subnetwork = "${google_compute_subnetwork.main.name}"

0 commit comments

Comments
 (0)