refactor: inline and simplify proxy_addrs()
This commit is contained in:
1 parent
dd772f04fe
commit
48ceb49832
1 file changed
+2
-7
@@ -1098,20 +1098,15 @@ proxy_args() {
|
||||
fi
|
||||
}
|
||||
|
||||
proxy_addrs() {
|
||||
proxy_addr() {
|
||||
if addr="$(call_weave GET /proxyaddrs)" ; then
|
||||
[ -n "$addr" ] || return 1
|
||||
echo "$addr" | sed "s/0.0.0.0/$PROXY_HOST/g" | tr '\n' ' '
|
||||
echo "$addr" | sed "s/0.0.0.0/$PROXY_HOST/g" | cut -d $'\n' -f1
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
proxy_addr() {
|
||||
addr=$(proxy_addrs) || return 1
|
||||
echo "$addr" | cut -d ' ' -f1
|
||||
}
|
||||
|
||||
warn_if_stopping_proxy_in_env() {
|
||||
if PROXY_ADDR=$(proxy_addr 2>/dev/null) ; then
|
||||
[ "$PROXY_ADDR" != "$DOCKER_CLIENT_HOST" ] || echo "WARNING: It appears that your environment is configured to use the Weave Docker API proxy. Stopping it will break this and subsequent docker invocations. To restore your environment, run 'eval \$(weave env --restore)'."
|
||||
|
||||
Reference in new issue
Block a user