Skip to content

Commit 81bfa3f

Browse files
committed
refactoring of gateway channel variable handling
1 parent 4fe24f1 commit 81bfa3f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cluster.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ resource "google_container_cluster" "primary" {
4949
}
5050

5151
dynamic "gateway_api_config" {
52-
for_each = local.gateway_api_config
52+
for_each = local.gateway_api_channel
5353

5454
content {
55-
channel = gateway_api_config.value.channel
55+
channel = gateway_api_channel.value
5656
}
5757
}
5858

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ locals {
5050
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
5151
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
5252

53-
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
54-
gateway_api_config = var.gateway_api_channel != null ? [{ channel : var.gateway_api_channel }] : []
53+
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
54+
gateway_api_channel = var.gateway_api_channel
5555

5656
autoscaling_resource_limits = var.cluster_autoscaling.enabled ? concat([{
5757
resource_type = "cpu"

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ output "release_channel" {
150150

151151
output "gateway_api_channel" {
152152
description = "The gateway api channel of this cluster"
153-
value = var.gateway_api_channel
153+
value = local.gateway_api_config.channel
154154
}
155155

156156
output "identity_namespace" {

0 commit comments

Comments
 (0)