From e4fe57a02c79e97309776d636394db2a83bc3d02 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 24 Oct 2014 10:03:49 +0100 Subject: [PATCH] Make extra container information optional --- weave | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/weave b/weave index cb1bda9a..efca257d 100755 --- a/weave +++ b/weave @@ -241,7 +241,8 @@ weave_ps() { for CONTAINER_ID in $(docker ps -q) ; do CONTAINER_IPS=$(with_container_netns container_weave_ips $CONTAINER_ID) if [ -n "$CONTAINER_IPS" ] ; then - echo $(docker inspect --format '{{ .Name }} {{ .Config.Image }} ({{ .Config.Hostname }}.{{ .Config.Domainname }}):' $CONTAINER_ID) $CONTAINER_IPS + [ $# -gt 0 ] && [ "$1" = "-v" ] && CONTAINER_INFO=$(docker inspect --format '{{ .Name }} {{ .Config.Image }}' $CONTAINER_ID) + echo $CONTAINER_ID $CONTAINER_INFO $CONTAINER_IPS fi done } @@ -304,7 +305,7 @@ case "$COMMAND" in fi ;; ps) - weave_ps + weave_ps "$@" ;; version) # Try the running container first; if no luck try the image