berth updates
This commit is contained in:
@@ -123,3 +123,25 @@ except ValueError:
|
||||
sys.exit(2)
|
||||
' "$1" "$2"
|
||||
}
|
||||
|
||||
# The upstream a service actually resolves to, as "host:port".
|
||||
#
|
||||
# A PLACED service has no literal `upstream` field: ✖ B9 replaced langfuse's
|
||||
# hand-written `10.8.0.2:3000` with placement+peer+port, because being reached
|
||||
# by address on the overlay is ONE decision, not three properties. Everything
|
||||
# that asks "what does this service point at" must therefore resolve it the
|
||||
# same way, or it silently sees an empty string and skips the service — which
|
||||
# is exactly how vpn.sh's bindings invariant went quiet after B9 landed.
|
||||
#
|
||||
# usage: service_upstream <up> <placement> <peer> <port>
|
||||
service_upstream() {
|
||||
local up="$1" placement="$2" peer="$3" port="$4"
|
||||
case "$placement" in
|
||||
local|instance)
|
||||
local addr; addr="$(overlay_get estate "peers.${peer}.address")"
|
||||
[ -z "$addr" ] && return 1
|
||||
printf '%s:%s' "$addr" "$port"
|
||||
;;
|
||||
*) printf '%s' "$up" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user