Move awsvpc bridge expose from weave script to Go code

This commit is contained in:
Bryan Boreham committed 2017-04-17 19:41:47 +00:00
1 parent 41a261bdcd
commit ae625a18c8
3 files changed
+49 -14

No files matched your search

-14
View File
@@ -474,12 +474,6 @@ expose_ip() {
if ! ip addr show dev $BRIDGE | grep -qF $CIDR ; then
ip addr add dev $BRIDGE $CIDR
arp_update $BRIDGE $CIDR || true
# Remove a default route installed by the kernel, because awsvpc
# has installed it as well
if [ -n "$AWSVPC" ]; then
RCIDR=$(ip route list exact $CIDR proto kernel | head -n1 | cut -d' ' -f1)
[ -n "$RCIDR" ] && ip route del dev $BRIDGE proto kernel $RCIDR
fi
fi
[ -z "$FQDN" ] || when_weave_running put_dns_fqdn_no_check_alive weave:expose $FQDN $CIDR
done
@@ -1416,7 +1410,6 @@ launch_router() {
--resolv-conf "/var/run/weave/etc/$RESOLV_CONF_BASE" \
"$@")
wait_for_status $CONTAINER_NAME http_call $HTTP_ADDR
setup_awsvpc
if [ -n "$ENABLE_PLUGIN" ]; then
wait_for_status $CONTAINER_NAME http_call_unix $CONTAINER_NAME plugin-status.sock
@@ -1424,12 +1417,6 @@ launch_router() {
fi
}
setup_awsvpc() {
if [ -n "$AWSVPC" ]; then
expose_ip
fi
}
# Recreate the parameter values that are set when the router is first launched
fetch_router_args() {
CONTAINER_ARGS=$(docker inspect -f '{{.Args}}' $CONTAINER_NAME) || return 1
@@ -1660,7 +1647,6 @@ EOF
! docker inspect -f '{{.Config.Cmd}}' $CONTAINER_NAME | grep -q -- "--awsvpc" || AWSVPC=1
fetch_router_args
wait_for_status $CONTAINER_NAME http_call $HTTP_ADDR
setup_awsvpc
;;
launch-proxy)
deprecation_warnings "$@"