File tree Expand file tree Collapse file tree 9 files changed +23
-4
lines changed
examples/simple_regional_beta
beta-private-cluster-update-variant Expand file tree Collapse file tree 9 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ output "release_channel" {
169169
170170output "identity_namespace" {
171171 description = "Workload Identity namespace"
172- value = var. identity_namespace
172+ value = length(local.cluster_workload_identity_config) > 0 ? local.cluster_workload_identity_config[0]. identity_namespace : null
173173 depends_on = [
174174 google_container_cluster.primary
175175 ]
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ This example illustrates how to create a simple cluster with beta features.
3636| ca\_ certificate | |
3737| client\_ token | |
3838| cluster\_ name | Cluster name |
39+ | identity\_ namespace | |
3940| ip\_ range\_ pods | The secondary IP range used for pods |
4041| ip\_ range\_ services | The secondary IP range used for services |
4142| kubernetes\_ endpoint | |
Original file line number Diff line number Diff line change @@ -61,3 +61,7 @@ output "master_kubernetes_version" {
6161 description = " The master Kubernetes version"
6262 value = module. gke . master_version
6363}
64+
65+ output "identity_namespace" {
66+ value = module. gke . identity_namespace
67+ }
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ output "release_channel" {
166166
167167output "identity_namespace" {
168168 description = " Workload Identity namespace"
169- value = var . identity_namespace
169+ value = length (local . cluster_workload_identity_config ) > 0 ? local . cluster_workload_identity_config [ 0 ] . identity_namespace : null
170170 depends_on = [
171171 google_container_cluster . primary
172172 ]
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ output "release_channel" {
166166
167167output "identity_namespace" {
168168 description = " Workload Identity namespace"
169- value = var . identity_namespace
169+ value = length (local . cluster_workload_identity_config ) > 0 ? local . cluster_workload_identity_config [ 0 ] . identity_namespace : null
170170 depends_on = [
171171 google_container_cluster . primary
172172 ]
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ output "release_channel" {
156156
157157output "identity_namespace" {
158158 description = " Workload Identity namespace"
159- value = var . identity_namespace
159+ value = length (local . cluster_workload_identity_config ) > 0 ? local . cluster_workload_identity_config [ 0 ] . identity_namespace : null
160160 depends_on = [
161161 google_container_cluster . primary
162162 ]
Original file line number Diff line number Diff line change @@ -82,3 +82,7 @@ output "service_account" {
8282output "database_encryption_key_name" {
8383 value = google_kms_crypto_key. db . self_link
8484}
85+
86+ output "identity_namespace" {
87+ value = module. this . identity_namespace
88+ }
Original file line number Diff line number Diff line change 9191 "keyName" => attribute ( 'database_encryption_key_name' ) ,
9292 } )
9393 end
94+
95+ it "has the expected workload identity config" do
96+ expect ( data [ 'workloadIdentityConfig' ] ) . to eq ( {
97+ "identityNamespace" => attribute ( 'identity_namespace' ) ,
98+ "workloadPool" => attribute ( 'identity_namespace' ) ,
99+ } )
100+ end
94101 end
95102
96103 describe "default node pool" do
Original file line number Diff line number Diff line change @@ -31,3 +31,6 @@ attributes:
3131 - name : database_encryption_key_name
3232 required : true
3333 type : string
34+ - name : identity_namespace
35+ required : true
36+ type : string
You can’t perform that action at this time.
0 commit comments