Skip to content

Commit

Permalink
Use values(...) to fix glob expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Naser committed Mar 31, 2022
1 parent b61bc0b commit 3bb49ad
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion autogen/main/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ locals {
cluster_name = local.cluster_output_name
{% if autopilot_cluster != true %}
// node pool ID is in the form project/location/cluster/name
cluster_name_computed = element(split("/", element(google_container_node_pool.pools[*].id, 0)), length(split("/", element(google_container_node_pool.pools[*].id, 0))) - 2)
cluster_name_computed = element(split("/", element(values(google_container_node_pool.pools)[*].id, 0)), length(split("/", element(values(google_container_node_pool.pools)[*].id, 0))) - 3)
{% else %}
// cluster ID is in the form project/location/name
cluster_name_computed = element(split("/", local.cluster_id), length(split("/", local.cluster_id)) - 1)
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ locals {

cluster_name = local.cluster_output_name
// node pool ID is in the form project/location/cluster/name
cluster_name_computed = element(split("/", element(google_container_node_pool.pools[*].id, 0)), length(split("/", element(google_container_node_pool.pools[*].id, 0))) - 2)
cluster_name_computed = element(split("/", element(values(google_container_node_pool.pools)[*].id, 0)), length(split("/", element(values(google_container_node_pool.pools)[*].id, 0))) - 3)
cluster_network_tag = "gke-${var.name}"
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ locals {

cluster_name = local.cluster_output_name
// node pool ID is in the form project/location/cluster/name
cluster_name_computed = element(split("/", element(google_container_node_pool.pools[*].id, 0)), length(split("/", element(google_container_node_pool.pools[*].id, 0))) - 2)
cluster_name_computed = element(split("/", element(values(google_container_node_pool.pools)[*].id, 0)), length(split("/", element(values(google_container_node_pool.pools)[*].id, 0))) - 3)
cluster_network_tag = "gke-${var.name}"
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ locals {

cluster_name = local.cluster_output_name
// node pool ID is in the form project/location/cluster/name
cluster_name_computed = element(split("/", element(google_container_node_pool.pools[*].id, 0)), length(split("/", element(google_container_node_pool.pools[*].id, 0))) - 2)
cluster_name_computed = element(split("/", element(values(google_container_node_pool.pools)[*].id, 0)), length(split("/", element(values(google_container_node_pool.pools)[*].id, 0))) - 3)
cluster_network_tag = "gke-${var.name}"
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ locals {

cluster_name = local.cluster_output_name
// node pool ID is in the form project/location/cluster/name
cluster_name_computed = element(split("/", element(google_container_node_pool.pools[*].id, 0)), length(split("/", element(google_container_node_pool.pools[*].id, 0))) - 2)
cluster_name_computed = element(split("/", element(values(google_container_node_pool.pools)[*].id, 0)), length(split("/", element(values(google_container_node_pool.pools)[*].id, 0))) - 3)
cluster_network_tag = "gke-${var.name}"
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ locals {

cluster_name = local.cluster_output_name
// node pool ID is in the form project/location/cluster/name
cluster_name_computed = element(split("/", element(google_container_node_pool.pools[*].id, 0)), length(split("/", element(google_container_node_pool.pools[*].id, 0))) - 2)
cluster_name_computed = element(split("/", element(values(google_container_node_pool.pools)[*].id, 0)), length(split("/", element(values(google_container_node_pool.pools)[*].id, 0))) - 3)
cluster_network_tag = "gke-${var.name}"
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ locals {

cluster_name = local.cluster_output_name
// node pool ID is in the form project/location/cluster/name
cluster_name_computed = element(split("/", element(google_container_node_pool.pools[*].id, 0)), length(split("/", element(google_container_node_pool.pools[*].id, 0))) - 2)
cluster_name_computed = element(split("/", element(values(google_container_node_pool.pools)[*].id, 0)), length(split("/", element(values(google_container_node_pool.pools)[*].id, 0))) - 3)
cluster_network_tag = "gke-${var.name}"
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ locals {

cluster_name = local.cluster_output_name
// node pool ID is in the form project/location/cluster/name
cluster_name_computed = element(split("/", element(google_container_node_pool.pools[*].id, 0)), length(split("/", element(google_container_node_pool.pools[*].id, 0))) - 2)
cluster_name_computed = element(split("/", element(values(google_container_node_pool.pools)[*].id, 0)), length(split("/", element(values(google_container_node_pool.pools)[*].id, 0))) - 3)
cluster_network_tag = "gke-${var.name}"
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down

0 comments on commit 3bb49ad

Please sign in to comment.