Skip to content

Commit

Permalink
feat!: align keepers with ForceNew: true fields
Browse files Browse the repository at this point in the history
Will cause node pools to be re-created on update, unless remote state
of the `random_id` resources is manually modified to reflect the new keepers.

Fixes #1695
  • Loading branch information
lauraseidler committed Jul 24, 2023
1 parent 131278a commit f6d2c07
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 88 deletions.
25 changes: 3 additions & 22 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,12 @@ locals {
"disk_type",
"accelerator_count",
"accelerator_type",
"gpu_partition_size",
"enable_secure_boot",
"enable_integrity_monitoring",
"local_ssd_count",
"machine_type",
"placement_policy",
"max_pods_per_node",
"min_cpu_platform",
"pod_range",
Expand All @@ -545,6 +547,7 @@ locals {
"enable_gcfs",
"enable_gvnic",
"enable_secure_boot",
"boot_disk_kms_key",
]
}

Expand All @@ -561,18 +564,6 @@ resource "random_id" "name" {
local.force_node_pool_recreation_resources,
[for keeper in local.force_node_pool_recreation_resources : lookup(each.value, keeper, "")]
),
{
labels = join(",",
sort(
concat(
keys(local.node_pools_labels["all"]),
values(local.node_pools_labels["all"]),
keys(local.node_pools_labels[each.value["name"]]),
values(local.node_pools_labels[each.value["name"]])
)
)
)
},
{
taints = join(",",
sort(
Expand Down Expand Up @@ -606,16 +597,6 @@ resource "random_id" "name" {
)
)
)
},
{
tags = join(",",
sort(
concat(
local.node_pools_tags["all"],
local.node_pools_tags[each.value["name"]]
)
)
)
}
)
}
Expand Down
25 changes: 3 additions & 22 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,12 @@ locals {
"disk_type",
"accelerator_count",
"accelerator_type",
"gpu_partition_size",
"enable_secure_boot",
"enable_integrity_monitoring",
"local_ssd_count",
"machine_type",
"placement_policy",
"max_pods_per_node",
"min_cpu_platform",
"pod_range",
Expand All @@ -468,6 +470,7 @@ locals {
"enable_gcfs",
"enable_gvnic",
"enable_secure_boot",
"boot_disk_kms_key",
]
}

Expand All @@ -484,18 +487,6 @@ resource "random_id" "name" {
local.force_node_pool_recreation_resources,
[for keeper in local.force_node_pool_recreation_resources : lookup(each.value, keeper, "")]
),
{
labels = join(",",
sort(
concat(
keys(local.node_pools_labels["all"]),
values(local.node_pools_labels["all"]),
keys(local.node_pools_labels[each.value["name"]]),
values(local.node_pools_labels[each.value["name"]])
)
)
)
},
{
taints = join(",",
sort(
Expand Down Expand Up @@ -529,16 +520,6 @@ resource "random_id" "name" {
)
)
)
},
{
tags = join(",",
sort(
concat(
local.node_pools_tags["all"],
local.node_pools_tags[each.value["name"]]
)
)
)
}
)
}
Expand Down
25 changes: 3 additions & 22 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,12 @@ locals {
"disk_type",
"accelerator_count",
"accelerator_type",
"gpu_partition_size",
"enable_secure_boot",
"enable_integrity_monitoring",
"local_ssd_count",
"machine_type",
"placement_policy",
"max_pods_per_node",
"min_cpu_platform",
"pod_range",
Expand All @@ -449,6 +451,7 @@ locals {
"enable_gcfs",
"enable_gvnic",
"enable_secure_boot",
"boot_disk_kms_key",
]
}

Expand All @@ -465,18 +468,6 @@ resource "random_id" "name" {
local.force_node_pool_recreation_resources,
[for keeper in local.force_node_pool_recreation_resources : lookup(each.value, keeper, "")]
),
{
labels = join(",",
sort(
concat(
keys(local.node_pools_labels["all"]),
values(local.node_pools_labels["all"]),
keys(local.node_pools_labels[each.value["name"]]),
values(local.node_pools_labels[each.value["name"]])
)
)
)
},
{
taints = join(",",
sort(
Expand Down Expand Up @@ -510,16 +501,6 @@ resource "random_id" "name" {
)
)
)
},
{
tags = join(",",
sort(
concat(
local.node_pools_tags["all"],
local.node_pools_tags[each.value["name"]]
)
)
)
}
)
}
Expand Down
25 changes: 3 additions & 22 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,12 @@ locals {
"disk_type",
"accelerator_count",
"accelerator_type",
"gpu_partition_size",
"enable_secure_boot",
"enable_integrity_monitoring",
"local_ssd_count",
"machine_type",
"placement_policy",
"max_pods_per_node",
"min_cpu_platform",
"pod_range",
Expand All @@ -399,6 +401,7 @@ locals {
"enable_gcfs",
"enable_gvnic",
"enable_secure_boot",
"boot_disk_kms_key",
]
}

Expand All @@ -415,18 +418,6 @@ resource "random_id" "name" {
local.force_node_pool_recreation_resources,
[for keeper in local.force_node_pool_recreation_resources : lookup(each.value, keeper, "")]
),
{
labels = join(",",
sort(
concat(
keys(local.node_pools_labels["all"]),
values(local.node_pools_labels["all"]),
keys(local.node_pools_labels[each.value["name"]]),
values(local.node_pools_labels[each.value["name"]])
)
)
)
},
{
taints = join(",",
sort(
Expand Down Expand Up @@ -460,16 +451,6 @@ resource "random_id" "name" {
)
)
)
},
{
tags = join(",",
sort(
concat(
local.node_pools_tags["all"],
local.node_pools_tags[each.value["name"]]
)
)
)
}
)
}
Expand Down

0 comments on commit f6d2c07

Please sign in to comment.