From 6eff79ad644a176f43ca177bf7388152bf67b245 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 8 Apr 2024 13:34:23 +0200 Subject: [PATCH] Fail if no local_bind_port is defined --- templates/connect | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/connect b/templates/connect index 33edb69..63c64d0 100644 --- a/templates/connect +++ b/templates/connect @@ -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"