podman ps --format '{{.Label "mylabel"}}'
fails with executing "ps" at <.Label>: can't evaluate field Label in type containers.psReporter
#20957
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Issue Description
The same command does not fail when trying it out on docker.
Steps to reproduce the issue
Steps to reproduce the issue
sudo useradd test
sudo machinectl shell --uid test
podman run --rm --label mylabel=hello -q -d docker.io/library/alpine sleep inf
podman ps --format '{{.Label "mylabel"}}'
Describe the results you received
The command in step 4 fails and prints the error message
Describe the results you expected
I expected the command in step 4 to succeed and print
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
It works when using docker.
Side note 1:
In a more realistic scenario you would probably like to filter the containers
Side note 2:
I found this issue when looking at the issues in the nerdctl project. I checked if Podman had a similar issue as
nerdctl ps -a --filter label=io.x-k8s.kind.cluster --format '{{.Label "io.x-k8s.kind.cluster"}}'
behaviour is inconsistent with docker containerd/nerdctl#2598After that I found a similar old Podman issue from 2018:
that was closed.
Long time has gone since 2018. Maybe the issue is more relevant now?
Feel free to close this issue if it's of low priority.
The text was updated successfully, but these errors were encountered: