Let weaver create the bridge in net-plugin launch
This commit is contained in:
1 parent
f05bb6c4e0
commit
3b54372eab
2 files changed
+8
-33
No files matched your search
@@ -29,22 +29,11 @@ SWARM_MANAGER_PEERS=$(/usr/bin/weaveutil swarm-manager-peers)
|
|||||||
# Prevent from restoring from a persisted peers list
|
# Prevent from restoring from a persisted peers list
|
||||||
rm -f "/restart.sentinel"
|
rm -f "/restart.sentinel"
|
||||||
|
|
||||||
/home/weave/weave --local create-bridge \
|
router_bridge_opts() {
|
||||||
--proc-path=/host/proc \
|
echo --datapath=datapath
|
||||||
--weavedb-dir-path=$WEAVE_DIR \
|
[ -z "$WEAVE_MTU" ] || echo --mtu "$WEAVE_MTU"
|
||||||
--force
|
[ -z "$WEAVE_NO_FASTDP" ] || echo --no-fastdp
|
||||||
|
}
|
||||||
BRIDGE_OPTIONS="--datapath=datapath"
|
|
||||||
if [ "$(/home/weave/weave --local bridge-type)" = "bridge" ]; then
|
|
||||||
# TODO: Call into weave script to do this
|
|
||||||
if ! ip link show vethwe-pcap >/dev/null 2>&1; then
|
|
||||||
ip link add name vethwe-bridge type veth peer name vethwe-pcap
|
|
||||||
ip link set vethwe-bridge up
|
|
||||||
ip link set vethwe-pcap up
|
|
||||||
ip link set vethwe-bridge master weave
|
|
||||||
fi
|
|
||||||
BRIDGE_OPTIONS="--iface=vethwe-pcap"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$IPALLOC_INIT" ]; then
|
if [ -z "$IPALLOC_INIT" ]; then
|
||||||
IPALLOC_INIT="observer"
|
IPALLOC_INIT="observer"
|
||||||
@@ -53,7 +42,9 @@ if [ -z "$IPALLOC_INIT" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /home/weave/weaver $EXTRA_ARGS --port=6783 $BRIDGE_OPTIONS \
|
exec /home/weave/weaver $EXTRA_ARGS --port=6783 $(router_bridge_opts) \
|
||||||
|
--host-root=/host \
|
||||||
|
--proc-path=/host/proc \
|
||||||
--http-addr=$HTTP_ADDR --status-addr=$STATUS_ADDR \
|
--http-addr=$HTTP_ADDR --status-addr=$STATUS_ADDR \
|
||||||
--no-dns \
|
--no-dns \
|
||||||
--ipalloc-range=$IPALLOC_RANGE \
|
--ipalloc-range=$IPALLOC_RANGE \
|
||||||
|
|||||||
@@ -1625,22 +1625,6 @@ case "$COMMAND" in
|
|||||||
# intentionally undocumented since it assumes knowledge of weave
|
# intentionally undocumented since it assumes knowledge of weave
|
||||||
# internals
|
# internals
|
||||||
create-bridge)
|
create-bridge)
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
case "$1" in
|
|
||||||
--proc-path=*)
|
|
||||||
PROC_PATH="${1#*=}"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--weavedb-dir-path=*)
|
|
||||||
WEAVEDB_DIR_PATH="${1#*=}"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$1" != "--force" ] ; then
|
if [ "$1" != "--force" ] ; then
|
||||||
cat 1>&2 <<EOF
|
cat 1>&2 <<EOF
|
||||||
WARNING: 'weave create-bridge' is deprecated. Instead use 'weave attach-bridge'
|
WARNING: 'weave create-bridge' is deprecated. Instead use 'weave attach-bridge'
|
||||||
|
|||||||
Reference in new issue
Block a user