Skip to content

Commit 9b28f5c

Browse files
author
Katie Keel
authored
Make node pool taint non-mandatory (#43)
1 parent 850df2f commit 9b28f5c

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

node_pool/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
# node-pool-v3.5.0
2+
- Fixed taints so that Terraform won't error out if you don't specify them on a node pool
3+
4+
# node-pool-v3.4.0
5+
- Added taints to node pool module (mandatory, mistakenly)
6+
17
# node-pool-v3.3.1
28
- Added the ability to enable secure boot on nodes when the cluster uses shielded nodes. This can be enabled with the variable `enable_secure_boot`
9+
310
# node-pool-v3.3.0
411
- Added `node_metadata` parameter to control node metadata provided to workload, so that [workload identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) functionality may be used.
512

node_pool/inputs.tf

+1
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,5 @@ variable "enable_secure_boot" {
9090
variable "taint" {
9191
description = "Key value pairs of taints to apply on nodes in the pool"
9292
type = map
93+
default = null
9394
}

node_pool/main.tf

+4-5
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ resource "google_container_node_pool" "node_pool" {
7575
}
7676

7777
dynamic "taint" {
78-
for_each = [var.taint]
78+
for_each = toset(var.taint == null ? [] : [var.taint])
7979
content {
8080
# TF-UPGRADE-TODO: The automatic upgrade tool can't predict
8181
# which keys might be set in maps assigned here, so it has
8282
# produced a comprehensive set here. Consider simplifying
8383
# this after confirming which keys can be set in practice.
8484

85-
effect = taint.value.effect
86-
key = taint.value.key
87-
value = taint.value.value
85+
effect = var.taint.effect
86+
key = var.taint.key
87+
value = var.taint.value
8888
}
8989
}
9090

@@ -100,4 +100,3 @@ resource "google_container_node_pool" "node_pool" {
100100
create_before_destroy = true
101101
}
102102
}
103-

0 commit comments

Comments
 (0)