podman ps applies a default "running" filter and by default prints a list of running containers. This is said to have been done for Docker compat:
|
// Docker thinks that if status is given as an input, then we should override |
|
// the all setting and always deal with all containers. |
|
if len(options.Filters["status"]) > 0 { |
|
all = true |
|
} |
|
if !all { |
|
runningOnly, err := filters.GenerateContainerFilterFuncs("status", []string{define.ContainerStateRunning.String()}, runtime) |
|
if err != nil { |
|
return nil, err |
|
} |
|
filterFuncs = append(filterFuncs, runningOnly) |
|
} |
Whereas podman pod ps has no such filter and so, by default, it prints a list of pods in any state.
It might be worthwhile to have the same behavior for both. Docker doesn't have pods, so there's no 1-1 compat and perhaps that's the reason for the inconsistency.
Follows from #28707
podman psapplies a default "running" filter and by default prints a list of running containers. This is said to have been done for Docker compat:podman/pkg/ps/ps.go
Lines 55 to 66 in 90f38bc
Whereas
podman pod pshas no such filter and so, by default, it prints a list of pods in any state.It might be worthwhile to have the same behavior for both. Docker doesn't have pods, so there's no 1-1 compat and perhaps that's the reason for the inconsistency.
Follows from #28707