Fail if no local_bind_port is defined

This commit is contained in:
Daniel Berteaud 2024-04-08 13:34:23 +02:00
parent 2f03b5c8b5
commit 6eff79ad64
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,8 @@
local_bind_port = [[ $upstream.local_bind_port ]]
[[- else if and (has $ "connect_services") (has $.connect_services $upstream.destination_name) (has (index $.connect_services $upstream.destination_name) "port") ]]
local_bind_port = [[ (index $.connect_services $upstream.destination_name).port ]]
[[- else ]]
[[- test.Fail (printf "Service %s has no local_bind_port defined" $upstream.destination_name) ]]
[[- end ]]
# Work arround, see https://github.com/hashicorp/nomad/issues/18538
destination_type = "service"