Revert "Merge pull request #1580 from weaveworks/1579-launch-proxy-mount-h"
This reverts commit262352f8bb, reversing changes made to312691376adue to a bug whereby `weave env` returns a unix domain socket with an incorrect path. This change will be superceeded by #1694.
This commit is contained in:
1 parent
262352f8bb
commit
7987d09438
2 files changed
+6
-30
No files matched your search
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. ./config.sh
|
. ./config.sh
|
||||||
|
|
||||||
start_suite "Various launch-proxy configurations"
|
start_suite "Boot the proxy should only listen on client's interface"
|
||||||
|
|
||||||
# Booting it over unix socket listens on unix socket
|
# Booting it over unix socket listens on unix socket
|
||||||
run_on $HOST1 COVERAGE=$COVERAGE sudo -E weave launch-proxy
|
run_on $HOST1 COVERAGE=$COVERAGE sudo -E weave launch-proxy
|
||||||
@@ -22,11 +22,6 @@ assert_raises "run_on $HOST1 sudo docker -H unix:///var/run/weave/weave.sock ps"
|
|||||||
assert_raises "proxy docker_on $HOST1 ps"
|
assert_raises "proxy docker_on $HOST1 ps"
|
||||||
weave_on $HOST1 stop-proxy
|
weave_on $HOST1 stop-proxy
|
||||||
|
|
||||||
# Booting it with -H outside /var/run/weave, still works
|
|
||||||
socket="$(mktemp -d)/weave.sock"
|
|
||||||
weave_on $HOST1 launch-proxy -H unix://$socket
|
|
||||||
assert_raises "run_on $HOST1 sudo docker -H unix:///$socket ps" 0
|
|
||||||
weave_on $HOST1 stop-proxy
|
|
||||||
|
|
||||||
# Booting it over tls errors
|
# Booting it over tls errors
|
||||||
assert_raises "DOCKER_CLIENT_ARGS='--tls' weave_on $HOST1 launch-proxy" 1
|
assert_raises "DOCKER_CLIENT_ARGS='--tls' weave_on $HOST1 launch-proxy" 1
|
||||||
@@ -1266,36 +1266,17 @@ tls_arg() {
|
|||||||
PROXY_ARGS="$PROXY_ARGS $1 /home/weave/tls/$3.pem"
|
PROXY_ARGS="$PROXY_ARGS $1 /home/weave/tls/$3.pem"
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO: Handle relative paths for args
|
|
||||||
# TODO: Handle args with spaces
|
|
||||||
host_arg() {
|
|
||||||
PROXY_HOST="$1"
|
|
||||||
if [ "$PROXY_HOST" != "${PROXY_HOST#unix://}" ]; then
|
|
||||||
host=$(dirname ${PROXY_HOST#unix://})
|
|
||||||
if [ "$host" = "${host#/}" ]; then
|
|
||||||
echo "When launching the proxy, unix sockets must be specified as an absolute path." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ "$host" = "/var/run" ]; then
|
|
||||||
echo "WARNING: Proxying sockets whose immediate parent directory is /var/run is unreliable." >&2
|
|
||||||
echo "To work around this, put the unix socket in a subdirectory of /var/run, and symlink it into place." >&2
|
|
||||||
fi
|
|
||||||
PROXY_VOLUMES="$PROXY_VOLUMES -v $host:/host$host"
|
|
||||||
PROXY_ARGS="$PROXY_ARGS -H unix:///host$host/$(basename ${PROXY_HOST#unix://})"
|
|
||||||
else
|
|
||||||
PROXY_ARGS="$PROXY_ARGS -H $1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
proxy_parse_args() {
|
proxy_parse_args() {
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-H)
|
-H)
|
||||||
host_arg "$2"
|
PROXY_HOST="$2"
|
||||||
|
PROXY_ARGS="$PROXY_ARGS $1 $2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-H=*)
|
-H=*)
|
||||||
host_arg "${1#*=}"
|
PROXY_HOST="${1#*=}"
|
||||||
|
PROXY_ARGS="$PROXY_ARGS $1"
|
||||||
;;
|
;;
|
||||||
-no-detect-tls|--no-detect-tls)
|
-no-detect-tls|--no-detect-tls)
|
||||||
PROXY_TLS_DETECTION_DISABLED=1
|
PROXY_TLS_DETECTION_DISABLED=1
|
||||||
@@ -1356,7 +1337,7 @@ proxy_args() {
|
|||||||
PROXY_HOST="tcp://0.0.0.0:12375"
|
PROXY_HOST="tcp://0.0.0.0:12375"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
host_arg "$PROXY_HOST"
|
PROXY_ARGS="$PROXY_ARGS -H $PROXY_HOST"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user