diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-07-25 13:50:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-07-26 03:46:53 +0000 |
commit | 5c3fbecb207a39fc07d79988dd2b3f235338f2b3 (patch) | |
tree | d21399299ed36fc56a90c63aaf26eb30423d8106 /lib | |
parent | Speeding up container list command by not gathering IP addresses for output f... (diff) | |
download | compute-tools-5c3fbecb207a39fc07d79988dd2b3f235338f2b3.tar.xz compute-tools-5c3fbecb207a39fc07d79988dd2b3f235338f2b3.zip |
Speeding up container list command by optimizing IP address gathering.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | libexec/container/list | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/container/list b/libexec/container/list index 17a1958..6567afb 100755 --- a/libexec/container/list +++ b/libexec/container/list @@ -373,7 +373,8 @@ do ;; *) - ADDRESS="$(cnt run -n ${CONTAINER} -- hostname -I | sed -e 's|\r$||' | awk '{ print $1 }')" + LEADER="$(machinectl status ${CONTAINER} | awk '/Leader: / { print $2 }')" + ADDRESS="$(nsenter --all --target "${LEADER}" /bin/hostname -I | sed -e 's|\r$||' | awk '{ print $1 }')" ;; esac |