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

Docker compatibility: Filter query parameter is ignored for image endpoint #6797

Closed
skorhone opened this issue Jun 27, 2020 · 9 comments
Closed
Labels
HTTP API Bug is in RESTful API 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

@skorhone
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Docker /image/json should support filter query parameter. In docker engine documentation, filter parameter is described as:

  • filter - only return images with the specified name

Tools such as testcontainers require support for filter query parameter.

Steps to reproduce the issue:

  1. podman system service --log-level=debug --time=0 unix:///tmp/podman.sock

  2. curl --unix-socket /tmp/podman.sock "http://localhost/images/json?filter=testcontainersofficial%2Fryuk%3A0.3.0"

Describe the results you received:

Query returns all the images in local registry.

Describe the results you expected:

Query should return only images with specified name

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Version:      2.0.0
API Version:  1
Go Version:   go1.13.8
Built:        Thu Jan  1 02:00:00 1970
OS/Arch:      linux/amd64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 27, 2020
@mheon
Copy link
Member

mheon commented Jun 27, 2020

That filter parameter does not look correct - we're expecting a map of filter name to filter parameters, JSON encoded (for this, probably the reference filter). If this works at all with Docker, it's not a documented part of their API.

@mheon mheon added the HTTP API Bug is in RESTful API label Jun 27, 2020
@skorhone
Copy link
Author

It is documented here: https://docs.docker.com/engine/api/v1.24/#32-images

@skorhone
Copy link
Author

skorhone commented Jun 27, 2020

It seems that parameter has been removed from documentation in 1.25. My initial google search found the 1.24 documentation, so I didn't check how other versions of api looked :-)

As you've observed more recent versions such as version 1.25 and version 1.40 of documentation no longer has parameter: https://docs.docker.com/engine/api/v1.25/#operation/ImageList . I don't have docker to test with, but I suspect that while not documented parameter is still allowed and processed correctly.

Considering it's the last query parameter in list and that there is no mention on removing it from api, it could be a documentation bug (unintended change) on docker side.

Edit: It was actually mentioned in docker engines changelog. For some reason it wasn't documented in API changelog

@skorhone
Copy link
Author

It seems filters=reference= is functionally equivalent. I'll create an issue to docker-java project.

To keep podman backwards compatible with other tools, I suggest that you add this functionality.

@skorhone
Copy link
Author

Deprecated filter parameter is getting removed from Moby.

moby/moby#40491

@bsideup
Copy link

bsideup commented Jul 2, 2020

@skorhone correction: it is getting removed from API 1.41 (to be released) and higher:

The parameter remains available when using API version 1.40 or below.

Which means that the latest released Docker still supports the parameter and works with the tooling that uses it and wants to be compatible with 1.24 version of Docker's API.

@skorhone
Copy link
Author

skorhone commented Jul 2, 2020

Yes, but to continue to use that filter, you need to specify the exact version of api you want to use. If you do not specify version (in path), you will be effectively using latest version - and latest no longer supports it starting from 1.41.

While I was testing use of podman with testcontainers, I don't recall seeing in my tcpdumps that testcontainers would specify api version in requests. This is one of the reasons why I thought you would be interested in this - and to me, a fix seemed like a trivial to implement.

Also, I don't think I've said or at least I didn't intend to say that support for parameter has been dropped out in 1.40. I just mentioned, that it no longer exists in that version of documentation :-)

When it comes to podman, I think we can close this issue. I don't think podman should support a feature that original authors have deprecated long ago.

@mheon Considering all this, should I close this issue?

@bsideup
Copy link

bsideup commented Jul 2, 2020

FTR docker-java will use the lowest supported API version (1.24). You can of course close the issue, but it will remain a compatibility blocker. Just saying.

@skorhone
Copy link
Author

skorhone commented Jul 7, 2020

Resolved with #6878

@skorhone skorhone closed this as completed Jul 7, 2020
@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 Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
HTTP API Bug is in RESTful API 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
Development

No branches or pull requests

4 participants