Add 'weave restart' command
This commit is contained in:
1 parent
f84b933d7c
commit
7985e43e68
3 files changed
+27
No files matched your search
@@ -167,6 +167,11 @@ the weave network:
|
||||
host1$ weave ps a1
|
||||
a1 16:c0:6f:5d:c5:73 10.32.0.3/12
|
||||
|
||||
There is also a `weave restart` command, if you are not using the
|
||||
weave Docker API proxy:
|
||||
|
||||
host1$ weave restart b1
|
||||
|
||||
(note that the IP address is held for a limited time - currently five seconds)
|
||||
|
||||
### <a name="naming-and-discovery"></a>Naming and discovery
|
||||
|
||||
@@ -27,4 +27,12 @@ start_container $HOST2 net:$SUBNET_2 --name=c6
|
||||
C6=$(container_ip $HOST2 c6)
|
||||
assert_raises "exec_on $HOST1 c5 $PING $C6"
|
||||
|
||||
# check that restart retains the same IP, and reclaims it in IPAM
|
||||
weave_on $HOST2 restart c6
|
||||
assert_raises "exec_on $HOST1 c5 $PING $C6"
|
||||
sleep 6 # past the IPAM timeout
|
||||
start_container $HOST2 net:$SUBNET_2 --name=c7
|
||||
C7=$(container_ip $HOST2 c7)
|
||||
assert_raises "[ $C6 != $C7 ]"
|
||||
|
||||
end_suite
|
||||
@@ -63,6 +63,7 @@ weave run [--without-dns] [--no-rewrite-hosts] [--no-multicast-route]
|
||||
start [<addr> ...] <container_id>
|
||||
attach [<addr> ...] <container_id>
|
||||
detach [<addr> ...] <container_id>
|
||||
restart <container_id>
|
||||
|
||||
weave expose [<addr> ...] [-h <fqdn>]
|
||||
hide [<addr> ...]
|
||||
@@ -1045,6 +1046,10 @@ echo_ips() {
|
||||
done
|
||||
}
|
||||
|
||||
echo_cidrs() {
|
||||
echo $3
|
||||
}
|
||||
|
||||
peer_args() {
|
||||
res=''
|
||||
sep=''
|
||||
@@ -2026,6 +2031,15 @@ EOF
|
||||
done
|
||||
show_addrs $ALL_CIDRS
|
||||
;;
|
||||
restart)
|
||||
[ $# -ge 1 ] || usage
|
||||
create_bridge
|
||||
ALL_CIDRS=$(with_container_addresses echo_cidrs $1)
|
||||
RES=$(docker restart "$1")
|
||||
with_container_netns_or_die $1 attach $ALL_CIDRS
|
||||
when_weave_running with_container_fqdn $1 put_dns_fqdn $ALL_CIDRS
|
||||
echo $RES
|
||||
;;
|
||||
dns-add)
|
||||
collect_dns_add_remove_args "$@"
|
||||
FN=put_dns_fqdn
|
||||
|
||||
Reference in new issue
Block a user