New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Comments
rhatdan
added a commit
to rhatdan/podman
that referenced
this issue
Dec 9, 2023
Also fix support for --format '{{ .Podname }}' basically if user specifies .Podname this should imply --pod was passed. Fixes: containers#20957 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan
added a commit
to rhatdan/podman
that referenced
this issue
Dec 9, 2023
Also fix support for --format '{{ .Podname }}' basically if user specifies .Podname this should imply --pod was passed. Fixes: containers#20957 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan
added a commit
to rhatdan/podman
that referenced
this issue
Dec 9, 2023
Also fix support for --format '{{ .Podname }}' basically if user specifies .Podname this should imply --pod was passed. Fixes: containers#20957 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan
added a commit
to rhatdan/podman
that referenced
this issue
Dec 9, 2023
Also Support for podman pod ps --format '{{ .Label label }}' Finally fix support for --format '{{ .Podname }}' When user specifies .Podname this implies --pod was passed. Fixes: containers#20957 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan
added a commit
to rhatdan/podman
that referenced
this issue
Dec 11, 2023
Also Support for podman pod ps --format '{{ .Label label }}' Finally fix support for --format '{{ .Podname }}' When user specifies .Podname this implies --pod was passed. Fixes: containers#20957 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan
added a commit
to rhatdan/podman
that referenced
this issue
Dec 13, 2023
Also Support for podman pod ps --format '{{ .Label label }}' Finally fix support for --format '{{ .Podname }}' When user specifies .Podname this implies --pod was passed. Fixes: containers#20957 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
github-actions
bot
added
the
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
label
Mar 13, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: