summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-12-14 16:03:19 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-12-14 16:03:21 -0500
commit51a4bef2e62b500457bcd473a1d97ca150f4d1b4 (patch)
tree5a4c91f22f2a4955cfd9068461cdca479969e2d3
parentc36fb8b1138b112ec3d53e5cf89a2fbcb12e6840 (diff)
downloadpodman-51a4bef2e62b500457bcd473a1d97ca150f4d1b4.tar.gz
podman-51a4bef2e62b500457bcd473a1d97ca150f4d1b4.tar.bz2
podman-51a4bef2e62b500457bcd473a1d97ca150f4d1b4.zip
Show --external containers even without --all option
We currently do not show --external containers when the user specifies it, unless they also specify the --all flag. This has led to confusion. I see no reason not to list them without the --all flag if the user specifies the option. Fixes: https://github.com/containers/podman/issues/12353 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
-rw-r--r--docs/source/markdown/podman-ps.1.md2
-rw-r--r--pkg/ps/ps.go2
-rw-r--r--test/system/040-ps.bats12
3 files changed, 8 insertions, 8 deletions
diff --git a/docs/source/markdown/podman-ps.1.md b/docs/source/markdown/podman-ps.1.md
index 4bae3e6bd..827fb2b2f 100644
--- a/docs/source/markdown/podman-ps.1.md
+++ b/docs/source/markdown/podman-ps.1.md
@@ -34,7 +34,7 @@ Note: Podman shares containers storage with other tools such as Buildah and CRI-
#### **--external**
-Display external containers that are not controlled by Podman but are stored in containers storage. These external containers are generally created via other container technology such as Buildah or CRI-O and may depend on the same container images that Podman is also using. External containers are denoted with either a 'buildah' or 'storage' in the COMMAND and STATUS column of the ps output. Only used with the --all option.
+Display external containers that are not controlled by Podman but are stored in containers storage. These external containers are generally created via other container technology such as Buildah or CRI-O and may depend on the same container images that Podman is also using. External containers are denoted with either a 'buildah' or 'storage' in the COMMAND and STATUS column of the ps output.
#### **--filter**, **-f**
diff --git a/pkg/ps/ps.go b/pkg/ps/ps.go
index 90ad23f49..848a23ce7 100644
--- a/pkg/ps/ps.go
+++ b/pkg/ps/ps.go
@@ -74,7 +74,7 @@ func GetContainerLists(runtime *libpod.Runtime, options entities.ContainerListOp
}
}
- if options.All && options.External {
+ if options.External {
listCon, err := GetExternalContainerLists(runtime)
if err != nil {
return nil, err
diff --git a/test/system/040-ps.bats b/test/system/040-ps.bats
index 09a0f8de1..61b290415 100644
--- a/test/system/040-ps.bats
+++ b/test/system/040-ps.bats
@@ -83,10 +83,10 @@ load helpers
run_podman rm -a
}
-@test "podman ps -a --external" {
+@test "podman ps --external" {
# Setup: ensure that we have no hidden storage containers
- run_podman ps --external -a
+ run_podman ps --external
is "${#lines[@]}" "1" "setup check: no storage containers at start of test"
# Force a buildah timeout; this leaves a buildah container behind
@@ -107,7 +107,7 @@ EOF
run_podman ps -a
is "${#lines[@]}" "1" "podman ps -a does not see buildah containers"
- run_podman ps --external -a
+ run_podman ps --external
is "${#lines[@]}" "3" "podman ps -a --external sees buildah containers"
is "${lines[1]}" \
"[0-9a-f]\{12\} \+$IMAGE *buildah .* seconds ago .* storage .* ${PODMAN_TEST_IMAGE_NAME}-working-container" \
@@ -115,7 +115,7 @@ EOF
# 'rm -a' should be a NOP
run_podman rm -a
- run_podman ps --external -a
+ run_podman ps --external
is "${#lines[@]}" "3" "podman ps -a --external sees buildah containers"
# Cannot prune intermediate image as it's being used by a buildah
@@ -128,7 +128,7 @@ EOF
is "${#lines[@]}" "1" "Image used by build container is pruned"
# One buildah container has been removed.
- run_podman ps --external -a
+ run_podman ps --external
is "${#lines[@]}" "2" "podman ps -a --external sees buildah containers"
cid="${lines[1]:0:12}"
@@ -140,7 +140,7 @@ EOF
# With -f, we can remove it.
run_podman rm -t 0 -f "$cid"
- run_podman ps --external -a
+ run_podman ps --external
is "${#lines[@]}" "1" "storage container has been removed"
}