Skip to content

Commit

Permalink
fix: node pool options cannot be set to false (#2187)
Browse files Browse the repository at this point in the history
  • Loading branch information
TPXP authored Nov 16, 2024
1 parent 5e67ff4 commit 752db66
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 32 deletions.
6 changes: 2 additions & 4 deletions autogen/main/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ locals {
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
{% if autopilot_cluster != true %}
// Build a map of maps of node pools from a list of objects
node_pool_names = [for np in toset(var.node_pools) : np.name]
node_pools = zipmap(local.node_pool_names, tolist(toset(var.node_pools)))
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
node_pools = {for np in var.node_pools: np.name => np}
windows_node_pools = {for np in var.windows_node_pools: np.name => np}
{% endif %}

fleet_membership = var.fleet_project != null ? google_container_cluster.primary.fleet[0].membership : null
Expand Down
6 changes: 2 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ locals {
master_version_zonal = var.kubernetes_version != "latest" ? var.kubernetes_version : data.google_container_engine_versions.zone.latest_master_version
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
// Build a map of maps of node pools from a list of objects
node_pool_names = [for np in toset(var.node_pools) : np.name]
node_pools = zipmap(local.node_pool_names, tolist(toset(var.node_pools)))
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
node_pools = { for np in var.node_pools : np.name => np }
windows_node_pools = { for np in var.windows_node_pools : np.name => np }

fleet_membership = var.fleet_project != null ? google_container_cluster.primary.fleet[0].membership : null

Expand Down
6 changes: 2 additions & 4 deletions modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ locals {
master_version_zonal = var.kubernetes_version != "latest" ? var.kubernetes_version : data.google_container_engine_versions.zone.latest_master_version
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
// Build a map of maps of node pools from a list of objects
node_pool_names = [for np in toset(var.node_pools) : np.name]
node_pools = zipmap(local.node_pool_names, tolist(toset(var.node_pools)))
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
node_pools = { for np in var.node_pools : np.name => np }
windows_node_pools = { for np in var.windows_node_pools : np.name => np }

fleet_membership = var.fleet_project != null ? google_container_cluster.primary.fleet[0].membership : null

Expand Down
6 changes: 2 additions & 4 deletions modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ locals {
master_version_zonal = var.kubernetes_version != "latest" ? var.kubernetes_version : data.google_container_engine_versions.zone.latest_master_version
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
// Build a map of maps of node pools from a list of objects
node_pool_names = [for np in toset(var.node_pools) : np.name]
node_pools = zipmap(local.node_pool_names, tolist(toset(var.node_pools)))
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
node_pools = { for np in var.node_pools : np.name => np }
windows_node_pools = { for np in var.windows_node_pools : np.name => np }

fleet_membership = var.fleet_project != null ? google_container_cluster.primary.fleet[0].membership : null

Expand Down
6 changes: 2 additions & 4 deletions modules/beta-public-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ locals {
master_version_zonal = var.kubernetes_version != "latest" ? var.kubernetes_version : data.google_container_engine_versions.zone.latest_master_version
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
// Build a map of maps of node pools from a list of objects
node_pool_names = [for np in toset(var.node_pools) : np.name]
node_pools = zipmap(local.node_pool_names, tolist(toset(var.node_pools)))
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
node_pools = { for np in var.node_pools : np.name => np }
windows_node_pools = { for np in var.windows_node_pools : np.name => np }

fleet_membership = var.fleet_project != null ? google_container_cluster.primary.fleet[0].membership : null

Expand Down
6 changes: 2 additions & 4 deletions modules/beta-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ locals {
master_version_zonal = var.kubernetes_version != "latest" ? var.kubernetes_version : data.google_container_engine_versions.zone.latest_master_version
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
// Build a map of maps of node pools from a list of objects
node_pool_names = [for np in toset(var.node_pools) : np.name]
node_pools = zipmap(local.node_pool_names, tolist(toset(var.node_pools)))
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
node_pools = { for np in var.node_pools : np.name => np }
windows_node_pools = { for np in var.windows_node_pools : np.name => np }

fleet_membership = var.fleet_project != null ? google_container_cluster.primary.fleet[0].membership : null

Expand Down
6 changes: 2 additions & 4 deletions modules/private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ locals {
master_version_zonal = var.kubernetes_version != "latest" ? var.kubernetes_version : data.google_container_engine_versions.zone.latest_master_version
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
// Build a map of maps of node pools from a list of objects
node_pool_names = [for np in toset(var.node_pools) : np.name]
node_pools = zipmap(local.node_pool_names, tolist(toset(var.node_pools)))
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
node_pools = { for np in var.node_pools : np.name => np }
windows_node_pools = { for np in var.windows_node_pools : np.name => np }

fleet_membership = var.fleet_project != null ? google_container_cluster.primary.fleet[0].membership : null

Expand Down
6 changes: 2 additions & 4 deletions modules/private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ locals {
master_version_zonal = var.kubernetes_version != "latest" ? var.kubernetes_version : data.google_container_engine_versions.zone.latest_master_version
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
// Build a map of maps of node pools from a list of objects
node_pool_names = [for np in toset(var.node_pools) : np.name]
node_pools = zipmap(local.node_pool_names, tolist(toset(var.node_pools)))
windows_node_pool_names = [for np in toset(var.windows_node_pools) : np.name]
windows_node_pools = zipmap(local.windows_node_pool_names, tolist(toset(var.windows_node_pools)))
node_pools = { for np in var.node_pools : np.name => np }
windows_node_pools = { for np in var.windows_node_pools : np.name => np }

fleet_membership = var.fleet_project != null ? google_container_cluster.primary.fleet[0].membership : null

Expand Down

0 comments on commit 752db66

Please sign in to comment.