not filling nodeport if the type is not nodeport

This commit is contained in:
pierre geeraert
2026-10-12 00:16:07 +01:00
parent 437891b2d4
commit b27bfe5714
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ resource "kubernetes_service_v1" "automatic_service" {
port = port.value
target_port = port.value
name = replace("${port.value}${each.key}", "/(.{0,15})(.*)/", "$1")
node_port = port.value
node_port = each.value.service_type == "NodePort" ? port.value : 0
}
}