Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #489 Identity namespace output for beta clusters #500

Merged
merged 2 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autogen/main/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ output "release_channel" {

output "identity_namespace" {
description = "Workload Identity namespace"
value = var.identity_namespace
value = length(local.cluster_workload_identity_config) > 0 ? local.cluster_workload_identity_config[0].identity_namespace : null
depends_on = [
google_container_cluster.primary
]
Expand Down
1 change: 1 addition & 0 deletions examples/simple_regional_beta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ This example illustrates how to create a simple cluster with beta features.
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| identity\_namespace | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
4 changes: 4 additions & 0 deletions examples/simple_regional_beta/test_outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ output "master_kubernetes_version" {
description = "The master Kubernetes version"
value = module.gke.master_version
}

output "identity_namespace" {
value = module.gke.identity_namespace
}
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ output "release_channel" {

output "identity_namespace" {
description = "Workload Identity namespace"
value = var.identity_namespace
value = length(local.cluster_workload_identity_config) > 0 ? local.cluster_workload_identity_config[0].identity_namespace : null
depends_on = [
google_container_cluster.primary
]
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ output "release_channel" {

output "identity_namespace" {
description = "Workload Identity namespace"
value = var.identity_namespace
value = length(local.cluster_workload_identity_config) > 0 ? local.cluster_workload_identity_config[0].identity_namespace : null
depends_on = [
google_container_cluster.primary
]
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ output "release_channel" {

output "identity_namespace" {
description = "Workload Identity namespace"
value = var.identity_namespace
value = length(local.cluster_workload_identity_config) > 0 ? local.cluster_workload_identity_config[0].identity_namespace : null
depends_on = [
google_container_cluster.primary
]
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/beta_cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ output "service_account" {
output "database_encryption_key_name" {
value = google_kms_crypto_key.db.self_link
}

output "identity_namespace" {
value = module.this.identity_namespace
}
7 changes: 7 additions & 0 deletions test/integration/beta_cluster/controls/gcloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@
"keyName" => attribute('database_encryption_key_name'),
})
end

it "has the expected workload identity config" do
expect(data['workloadIdentityConfig']).to eq({
"identityNamespace" => attribute('identity_namespace'),
"workloadPool" => attribute('identity_namespace'),
})
end
end

describe "default node pool" do
Expand Down
3 changes: 3 additions & 0 deletions test/integration/beta_cluster/inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ attributes:
- name: database_encryption_key_name
required: true
type: string
- name: identity_namespace
required: true
type: string