Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary netns switch for router in attach_router,
Browse files Browse the repository at this point in the history
and improve the name of the function which sends existing
container data into the router
  • Loading branch information
bboreham authored and rade committed Mar 17, 2016
1 parent aa1c1cc commit 4903c2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions weave
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ launch_router() {
"$@"
setup_router_iface_$BRIDGE_TYPE
wait_for_status $CONTAINER_NAME http_call $HTTP_ADDR
[ -n "$ALREADY_RUNNING_CONTAINER" ] || attach_router
[ -n "$ALREADY_RUNNING_CONTAINER" ] || populate_router
}

# Recreate the parameter values that are set when the router is first launched
Expand All @@ -1654,7 +1654,7 @@ fetch_router_args() {
NO_DNS_OPT=$(echo $CONTAINER_ARGS | grep -o -e '--no-dns') || true
}

attach_router() {
populate_router() {
if [ -n "$IPRANGE" ] ; then
# Tell the newly-started weave IP allocator about existing weave IPs
with_container_addresses ipam_reclaim weave:expose $(docker ps -q --no-trunc)
Expand Down Expand Up @@ -1893,9 +1893,9 @@ EOF
enforce_docker_bridge_addr_assign_type
create_bridge
fetch_router_args
with_container_netns $CONTAINER_NAME setup_router_iface_$BRIDGE_TYPE
setup_router_iface_$BRIDGE_TYPE
wait_for_status $CONTAINER_NAME http_call $HTTP_ADDR
attach_router
populate_router
;;
launch-proxy)
deprecation_warnings "$@"
Expand Down

0 comments on commit 4903c2b

Please sign in to comment.