Make extra container information optional
This commit is contained in:
1 parent
f7eeb1f844
commit
e4fe57a02c
1 file changed
+3
-2
@@ -241,7 +241,8 @@ weave_ps() {
|
|||||||
for CONTAINER_ID in $(docker ps -q) ; do
|
for CONTAINER_ID in $(docker ps -q) ; do
|
||||||
CONTAINER_IPS=$(with_container_netns container_weave_ips $CONTAINER_ID)
|
CONTAINER_IPS=$(with_container_netns container_weave_ips $CONTAINER_ID)
|
||||||
if [ -n "$CONTAINER_IPS" ] ; then
|
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
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -304,7 +305,7 @@ case "$COMMAND" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
ps)
|
ps)
|
||||||
weave_ps
|
weave_ps "$@"
|
||||||
;;
|
;;
|
||||||
version)
|
version)
|
||||||
# Try the running container first; if no luck try the image
|
# Try the running container first; if no luck try the image
|
||||||
|
|||||||
Reference in new issue
Block a user