From 13f3439a06d764ba50ca8f89359bccb335ff9a96 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 8 Apr 2015 15:38:23 +0100 Subject: [PATCH 1/2] Allow container names to be supplied to 'weave ps' --- weave | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weave b/weave index 3e6c83a6..3d5eb096 100755 --- a/weave +++ b/weave @@ -25,7 +25,7 @@ usage() { echo "weave detach [ ...] " echo "weave expose " echo "weave hide " - echo "weave ps" + echo "weave ps [ ...]" echo "weave status" echo "weave version" echo "weave stop" @@ -675,8 +675,8 @@ case "$COMMAND" in http_call $DNS_CONTAINER_NAME $DNS_HTTP_PORT GET /status 2>/dev/null || true ;; ps) - [ $# -eq 0 ] || usage - for CONTAINER_ID in $(docker ps -q) ; do + [ $# -eq 0 ] && CONTAINERS="$(docker ps -q)" || CONTAINERS="$@" + for CONTAINER_ID in $CONTAINERS ; do if CONTAINER_ADDRS=$(with_container_netns $CONTAINER_ID container_weave_addrs 2>&1) ; then CONTAINER_MAC=$(echo "$CONTAINER_ADDRS" | grep -o 'link/ether .*' | cut -d ' ' -f 2) CONTAINER_IPS=$(echo "$CONTAINER_ADDRS" | grep -o 'inet .*' | cut -d ' ' -f 2) From 10bd84a4601bf2bb1ff56d2e621998e4a6a7c233 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 10 Apr 2015 15:08:35 +0100 Subject: [PATCH 2/2] Document name-list option to weave ps --- site/troubleshooting.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/site/troubleshooting.md b/site/troubleshooting.md index 84b794b0..76adf542 100644 --- a/site/troubleshooting.md +++ b/site/troubleshooting.md @@ -146,6 +146,12 @@ IP address/routing prefix length ([CIDR notation](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)) assigned on the weave network. +You can also supply a list of container IDs/names to `weave ps`, like this: + + $ sudo weave ps able baker + able ce:15:34:a9:b5:6d 10.2.5.1/24 + baker 7a:61:a2:49:4b:91 10.2.8.3/24 + ### Reboots When a host reboots, docker's default behaviour is to restart any