Skip to content
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

Image Filtering Incompatability with Docker API #18092

Closed
azdle opened this issue Apr 6, 2023 · 0 comments · Fixed by #18345
Closed

Image Filtering Incompatability with Docker API #18092

azdle opened this issue Apr 6, 2023 · 0 comments · Fixed by #18345
Assignees
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

@azdle
Copy link

azdle commented Apr 6, 2023

Issue Description

Attempting to filter images by label value via the compat HTTP API doesn't find images that definitely exist with the set labels. The same requests with the docker socket (after the same set of calls to create a labeled image) do return images.

There seems to be something about a new and old format for filters, this seems to only apply to how the new filters are handled.

Steps to reproduce the issue

  1. run podman image pull docker.io/ubuntu:22.04
  2. run:
curl --unix-socket /run/user/1000/podman/podman.sock --get 'http://_/images/json' \
--data-urlencode 'filters={"label": ["org.opencontainers.image.ref.name=ubuntu", "org.opencontainers.image.version=22.04"]}'

Describe the results you received

This returns [].

Describe the results you expected

I would expect this to return the same thing as:

curl --unix-socket /run/user/1000/podman/podman.sock --get 'http://_/images/json' \
--data-urlencode 'filters={"label": {"org.opencontainers.image.ref.name=ubuntu":true, "org.opencontainers.image.version=22.04": true}}'

Which returns:

[
  {
    "Id": "sha256:08d22c0ceb150ddeb2237c5fa3129c0183f3cc6f5eeb2e7aa4016da3ad02140a",
    "ParentId": "",
    "RepoTags": [
      "docker.io/library/ubuntu:22.04",
      "docker.io/library/ubuntu:latest"
    ],
    "RepoDigests": [
      "docker.io/library/ubuntu@sha256:67211c14fa74f070d27cc59d69a7fa9aeff8e28ea118ef3babc295a0428a6d21",
      "docker.io/library/ubuntu@sha256:7a57c69fe1e9d5b97c5fe649849e79f2cfc3bf11d10bbd5218b4eb61716aebe6"
    ],
    "Created": 1678250667,
    "Size": 80337591,
    "SharedSize": 0,
    "VirtualSize": 80337591,
    "Labels": {
      "org.opencontainers.image.ref.name": "ubuntu",
      "org.opencontainers.image.version": "22.04"
    },
    "Containers": 496,
    "Names": [
      "docker.io/library/ubuntu:22.04",
      "docker.io/library/ubuntu:latest"
    ],
    "Digest": "sha256:67211c14fa74f070d27cc59d69a7fa9aeff8e28ea118ef3babc295a0428a6d21",
    "History": [
      "docker.io/library/ubuntu:latest",
      "docker.io/library/ubuntu:22.04"
    ]
  }
]

podman info output

Client:       Podman Engine
Version:      4.4.2
API Version:  4.4.2
Go Version:   go1.19.6
Built:        Wed Mar  1 05:22:59 2023
OS/Arch:      linux/amd64

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

No response

Additional information

When the above commands are run, but for the docker command/socket, both curl calls result in the same output.

@azdle azdle added the kind/bug Categorizes issue or PR as related to a bug. label Apr 6, 2023
@vrothberg vrothberg self-assigned this Apr 25, 2023
vrothberg added a commit to vrothberg/libpod that referenced this issue May 2, 2023
Podman and Docker clients split the filter map slightly different, so
account for that when parsing the filters in the image-listing endpoint.

Fixes: containers#18092
Signed-off-by: Valentin Rothberg <[email protected]>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/podman that referenced this issue May 3, 2023
Podman and Docker clients split the filter map slightly different, so
account for that when parsing the filters in the image-listing endpoint.

Fixes: containers#18092
Signed-off-by: Valentin Rothberg <[email protected]>
@github-actions 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 Aug 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2023
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.
Projects
None yet
2 participants