Skip to content

Commit e996de9

Browse files
committed
Backport changes to test fixtures into private cluster tests
1 parent 9e2593f commit e996de9

File tree

6 files changed

+14
-2
lines changed

6 files changed

+14
-2
lines changed

examples/simple_regional_private/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ data "google_compute_subnetwork" "subnetwork" {
3333
module "gke" {
3434
source = "../../"
3535
project_id = "${var.project_id}"
36-
name = "${local.cluster_type}-cluster"
36+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3737
regional = true
3838
region = "${var.region}"
3939
network = "${var.network}"

examples/simple_regional_private/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_private/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ data "google_compute_subnetwork" "subnetwork" {
3333
module "gke" {
3434
source = "../../"
3535
project_id = "${var.project_id}"
36-
name = "${local.cluster_type}-cluster"
36+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3737
regional = false
3838
region = "${var.region}"
3939
zones = "${var.zones}"

examples/simple_zonal_private/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/simple_regional_private/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_private/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}"

0 commit comments

Comments
 (0)