Skip to content

Commit 91a7a1f

Browse files
committed
add cluster_resource_labels in example module for test and add another test to gcloud control
1 parent 44d5be2 commit 91a7a1f

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

test/fixtures/shared/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ variable "zones" {
3535
variable "compute_engine_service_account" {
3636
description = "The email address of the service account to associate with the GKE cluster"
3737
}
38+
39+
variable "cluster_resource_labels" {
40+
type = "map"
41+
description = "Map containing cluster labels. Maximum of 64 labels"
42+
default = {}
43+
}
44+

test/fixtures/simple_regional/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ module "example" {
2626
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"
2727
ip_range_services = "${google_compute_subnetwork.main.secondary_ip_range.1.range_name}"
2828
compute_engine_service_account = "${var.compute_engine_service_account}"
29+
cluster_resource_labels = "${var.cluster_resource_labels}"
2930
}

test/integration/simple_regional/controls/gcloud.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@
5858
},
5959
})
6060
end
61+
62+
it "has cluster resource labels" do
63+
expect(data['resourceLabels']).to eq({
64+
created-by => "terraform",
65+
})
66+
end
6167
end
6268

6369
describe "default node pool" do
@@ -138,6 +144,10 @@
138144
)
139145
end
140146

147+
148+
149+
150+
141151
it "has the expected network tags" do
142152
expect(node_pools).to include(
143153
including(

0 commit comments

Comments
 (0)