Skip to content

Commit

Permalink
Merge pull request #88 from castai/fix-dynamic-dedicated-node-affinity
Browse files Browse the repository at this point in the history
fix: use node affinity objects instead of their keys when mapping
  • Loading branch information
vladklokun authored Aug 21, 2024
2 parents 4b20d47 + 805f30f commit d718c04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ resource "castai_node_template" "this" {
instance_types = try(dedicated_node_affinity.value.instance_types, [])

dynamic "affinity" {
for_each = try(dedicated_node_affinity.value.affinity, {})
for_each = flatten([lookup(dedicated_node_affinity.value, "affinity", [])])

content {
key = try(affinity.key, null)
operator = try(affinity.operator, null)
values = try(affinity.values, [])
key = try(affinity.value.key, null)
operator = try(affinity.value.operator, null)
values = try(affinity.value.values, [])
}
}
}
Expand Down

0 comments on commit d718c04

Please sign in to comment.