-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
ps command to list container with volume filter does not work #16019
Comments
The volume filter only searches for volume names AFAIK and not paths. |
When I do this:
then for
I get no output. But for
I do get the right output. That makes me feel that podman uses the wrong path to match against with the volume filter. Also podman/pkg/domain/filters/containers.go Line 139 in ab3d3f8
|
podman/pkg/domain/filters/containers.go Lines 150 to 155 in ab3d3f8
That does not seem right. It matches when source and dest both match, or when source matches. |
It matches when source matches and dest is not specified or is "" |
I have not examined the problem just looking at the code above. |
From what I've gathered, it seems like the behavior expected would be to match on the volume name or the mount point in the container (destination) rather than the mount point on the host (source). I'd be happy to take a swing at a PR for this. |
@jesselang Thanks, I assigned it to you. Feel free to ping me if you have any questions. |
A friendly reminder that this issue had no activity for 30 days. |
@jesselang any progress? |
I think I have a good handle on what needs to change, but have not had a chance to make the changes yet. I think I'll have some time to put towards this in the next few weeks. |
Hello @jesselang can i try this issue ? |
Sure, go for it @SamirPS . 🙂👍 |
@jesselang if i understand well the code need to be like this for _, mount := range containerConfig.Spec.Mounts {
if dest != "" && (mount.Source == source && mount.Destination == dest) {
return true
}
if dest == "" && mount.Destination == source {
return true
}
}
for _, vname := range containerConfig.NamedVolumes {
if dest != "" && (vname.Name == source && vname.Dest == dest) {
return true
}
if dest == "" && vname.Name == source {
return true
}
}
} ? |
@Luap99 Could you help out on this? |
If I redo the ticket step with this code, I have the machine listed with the volume data. Do I need to add a test or not? |
Modify the condition in line 149 in order to list container by mounting point. Closes containers#16019 Signed-off-by: SamirPS <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Use "ps" command to list container with volume filter does not work
Steps to reproduce the issue:
Describe the results you received:
No container returned
Describe the results you expected:
It should return all containers mounting volume to "/data" as docker works
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
orbrew info podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
The text was updated successfully, but these errors were encountered: