Skip to content

Commit 9012c79

Browse files
committed
Add service_account output, look up when testing zonal clusters
1 parent fc589dd commit 9012c79

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

autogen/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,8 @@ output "node_pools_versions" {
107107
description = "List of node pools versions"
108108
value = "${local.cluster_node_pools_versions}"
109109
}
110+
111+
output "service_account" {
112+
description = "The service account to default running nodes as if not overridden in `node_pools`."
113+
value = "${local.service_account}"
114+
}

modules/private-cluster/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,9 @@ output "node_pools_names" {
106106
output "node_pools_versions" {
107107
description = "List of node pools versions"
108108
value = "${local.cluster_node_pools_versions}"
109+
}
110+
111+
output "service_account" {
112+
description = "The service account to default running nodes as if not overridden in `node_pools`."
113+
value = "${local.service_account}"
109114
}

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,9 @@ output "node_pools_names" {
106106
output "node_pools_versions" {
107107
description = "List of node pools versions"
108108
value = "${local.cluster_node_pools_versions}"
109+
}
110+
111+
output "service_account" {
112+
description = "The service account to default running nodes as if not overridden in `node_pools`."
113+
value = "${local.service_account}"
109114
}

test/integration/simple_zonal/controls/gcloud.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
project_id = attribute('project_id')
1616
location = attribute('location')
1717
cluster_name = attribute('cluster_name')
18+
service_account = attribute('service_account')
1819

1920
credentials_path = attribute('credentials_path')
2021
ENV['CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE'] = credentials_path
@@ -83,7 +84,7 @@
8384
expect(node_pools).to include(
8485
including(
8586
"config" => including(
86-
"serviceAccount" => starting_with("tf-gke-simple-zonal-cluster@"),
87+
"serviceAccount" => service_account,
8788
),
8889
),
8990
)

test/integration/simple_zonal/inspec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ attributes:
2121
- name: client_token
2222
required: true
2323
type: string
24+
- name: service_account
25+
required: true
26+
type: string

0 commit comments

Comments
 (0)