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

Commit

Permalink
Merge pull request #526 from bboreham/extend-ps
Browse files Browse the repository at this point in the history
Allow container names/ids to be supplied to `weave ps`
  • Loading branch information
rade committed Apr 10, 2015
2 parents f88ce6e + 10bd84a commit 3a83570
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions site/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions weave
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ usage() {
echo "weave detach <cidr> [<cidr> ...] <container_id>"
echo "weave expose <cidr>"
echo "weave hide <cidr>"
echo "weave ps"
echo "weave ps [<container_id> ...]"
echo "weave status"
echo "weave version"
echo "weave stop"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3a83570

Please sign in to comment.