From 64ea86f11c7a1398ee7b8f2a7764eded49f8ad0c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 25 Jul 2021 15:37:07 +0200 Subject: Speeding up container list command by not gathering IP addresses for output format that don't need it. Signed-off-by: Daniel Baumann --- libexec/container/list | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libexec/container/list b/libexec/container/list index 3ef6e49..17a1958 100755 --- a/libexec/container/list +++ b/libexec/container/list @@ -368,7 +368,15 @@ do case "${STATE}" in started) - ADDRESS="$(cnt run -n ${CONTAINER} -- hostname -I | sed -e 's|\r$||' | awk '{ print $1 }')" + case "${FORMAT}" in + shell|sh) + ;; + + *) + ADDRESS="$(cnt run -n ${CONTAINER} -- hostname -I | sed -e 's|\r$||' | awk '{ print $1 }')" + ;; + esac + ADDRESS="${ADDRESS:-none}" ;; -- cgit v1.2.3