Skip to content

Commit 85bcc18

Browse files
author
Alan Nix
committed
fix: improved support for various tolerations
1 parent 30fd5e8 commit 85bcc18

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

examples/custom-tolerations/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ module "lacework_k8s_datacollector" {
1616
key = "spotInstance",
1717
operator = "Exists",
1818
effect = "NoSchedule"
19+
},
20+
{
21+
operator = "Exists",
22+
effect = "NoSchedule"
23+
},
24+
{
25+
operator = "Exists"
1926
}
2027
]
2128
}

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ resource "kubernetes_daemonset" "lacework_datacollector" {
6464
dynamic "toleration" {
6565
for_each = var.tolerations
6666
content {
67-
key = toleration.value["key"]
67+
key = lookup(toleration.value, "key", "")
6868
operator = lookup(toleration.value, "operator", "Equal")
6969
value = lookup(toleration.value, "operator", "Equal") == "Exists" ? "" : lookup(toleration.value, "value", "")
70-
effect = toleration.value["effect"]
70+
effect = lookup(toleration.value, "effect", "")
7171
}
7272
}
7373

0 commit comments

Comments
 (0)