Move creation of bridge inside router
This commit is contained in:
1 parent
dd232775e6
commit
e7e3608642
2 files changed
+20
-21
No files matched your search
@@ -281,7 +281,6 @@ DATAPATH=datapath
|
||||
CONTAINER_IFNAME=ethwe
|
||||
BRIDGE_IFNAME=v${CONTAINER_IFNAME}-bridge
|
||||
DATAPATH_IFNAME=v${CONTAINER_IFNAME}-datapath
|
||||
PCAP_IFNAME=v${CONTAINER_IFNAME}-pcap
|
||||
PORT=${WEAVE_PORT:-6783}
|
||||
HTTP_ADDR=${WEAVE_HTTP_ADDR:-127.0.0.1:6784}
|
||||
STATUS_ADDR=${WEAVE_STATUS_ADDR:-127.0.0.1:6782}
|
||||
@@ -576,16 +575,9 @@ configure_veth_attached_bridge() {
|
||||
ip link set $GUEST_IFNAME master $bridge
|
||||
}
|
||||
|
||||
router_opts_fastdp() {
|
||||
echo "--datapath $DATAPATH"
|
||||
}
|
||||
|
||||
router_opts_bridge() {
|
||||
echo "--iface $PCAP_IFNAME"
|
||||
}
|
||||
|
||||
router_opts_bridged_fastdp() {
|
||||
router_opts_fastdp "$@"
|
||||
router_bridge_opts() {
|
||||
echo --docker-bridge "$DOCKER_BRIDGE" --weave-bridge "$BRIDGE" --datapath "$DATAPATH"
|
||||
[ -z "$WEAVE_MTU" ] || echo --mtu "$WEAVE_MTU"
|
||||
}
|
||||
|
||||
ask_version() {
|
||||
@@ -1287,8 +1279,6 @@ common_launch_args() {
|
||||
launch_router() {
|
||||
LAUNCHING_ROUTER=1
|
||||
check_forwarding_rules
|
||||
enforce_docker_bridge_addr_assign_type
|
||||
|
||||
# backward compatibility...
|
||||
if is_cidr "$1" ; then
|
||||
echo "WARNING: $1 parameter ignored; 'weave launch' no longer takes a CIDR as the first parameter" >&2
|
||||
@@ -1358,11 +1348,7 @@ launch_router() {
|
||||
eval "set -- $ARGS"
|
||||
|
||||
setup_cni
|
||||
create_bridge
|
||||
# We set the router name to the bridge MAC, which in turn is
|
||||
# derived from the system UUID (if available), and thus stable
|
||||
# across reboots.
|
||||
PEERNAME=$(cat /sys/class/net/$BRIDGE/address)
|
||||
validate_bridge_type
|
||||
|
||||
if [ -z "$IPRANGE_SPECIFIED" ] ; then
|
||||
IPRANGE="10.32.0.0/12"
|
||||
@@ -1415,8 +1401,8 @@ launch_router() {
|
||||
-e WEAVE_PASSWORD \
|
||||
-e CHECKPOINT_DISABLE \
|
||||
$WEAVE_DOCKER_ARGS $IMAGE $COVERAGE_ARGS \
|
||||
--port $CONTAINER_PORT --name "$PEERNAME" --nickname "$(hostname)" \
|
||||
$(router_opts_$BRIDGE_TYPE) \
|
||||
--port $CONTAINER_PORT --nickname "$(hostname)" \
|
||||
$(router_bridge_opts) \
|
||||
--ipalloc-range "$IPRANGE" \
|
||||
--dns-effective-listen-address $DOCKER_BRIDGE_IP \
|
||||
$DNS_ROUTER_OPTS $NO_DNS_OPT \
|
||||
@@ -1705,7 +1691,6 @@ EOF
|
||||
enforce_docker_bridge_addr_assign_type
|
||||
# We cannot use detect_awsvpc here, because HTTP server might not be started
|
||||
! docker inspect -f '{{.Config.Cmd}}' $CONTAINER_NAME | grep -q -- "--awsvpc" || AWSVPC=1
|
||||
create_bridge
|
||||
fetch_router_args
|
||||
wait_for_status $CONTAINER_NAME http_call $HTTP_ADDR
|
||||
setup_awsvpc
|
||||
|
||||
Reference in new issue
Block a user