diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-08 19:34:19 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 03:32:52 +0000 |
| commit | 3d7bf7da2d9371dde3053efc5b376f9664ece3ea (patch) | |
| tree | 1e554b8eee455d965694d5837b6676eac26b910d /recipes-containers/vcontainer | |
| parent | f367e1c738b72fd6bd9a704a11f50db838f47702 (diff) | |
| download | meta-virtualization-3d7bf7da2d9371dde3053efc5b376f9664ece3ea.tar.gz | |
vcontainer: fix ps -q to suppress port forward display
When using `ps -q` or `ps --quiet`, only container IDs should be output.
The port forward registry display was being included, which broke cleanup
code that expected just container IDs.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/vcontainer')
| -rwxr-xr-x | recipes-containers/vcontainer/files/vcontainer-common.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/recipes-containers/vcontainer/files/vcontainer-common.sh b/recipes-containers/vcontainer/files/vcontainer-common.sh index 9003e0c7..b0623164 100755 --- a/recipes-containers/vcontainer/files/vcontainer-common.sh +++ b/recipes-containers/vcontainer/files/vcontainer-common.sh | |||
| @@ -1333,7 +1333,15 @@ case "$COMMAND" in | |||
| 1333 | PS_EXIT=$? | 1333 | PS_EXIT=$? |
| 1334 | 1334 | ||
| 1335 | # Show host port forwards if daemon is running and we have any | 1335 | # Show host port forwards if daemon is running and we have any |
| 1336 | if daemon_is_running; then | 1336 | # Skip if -q/--quiet flag is present (only container IDs requested) |
| 1337 | PS_QUIET=false | ||
| 1338 | for arg in "${COMMAND_ARGS[@]}"; do | ||
| 1339 | case "$arg" in | ||
| 1340 | -q|--quiet) PS_QUIET=true; break ;; | ||
| 1341 | esac | ||
| 1342 | done | ||
| 1343 | |||
| 1344 | if [ "$PS_QUIET" = "false" ] && daemon_is_running; then | ||
| 1337 | pf_file=$(get_port_forward_file) | 1345 | pf_file=$(get_port_forward_file) |
| 1338 | if [ -f "$pf_file" ] && [ -s "$pf_file" ]; then | 1346 | if [ -f "$pf_file" ] && [ -s "$pf_file" ]; then |
| 1339 | echo "" | 1347 | echo "" |
