diff options
-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 |