-
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
APIv2 incompatibilities with docker-py #5553
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
openshift-ci-robot
added
the
kind/bug
Categorizes issue or PR as related to a bug.
label
Mar 19, 2020
@max-arnold great issue ... |
@max-arnold i have a patch for the first one ... |
The next version of podman should fix the first one. |
baude
added a commit
to baude/podman
that referenced
this issue
Mar 19, 2020
honor -1 in in list containers for compatibility mode. it is commonly used to indicate no limit. change the json id parameter to Id in container create. Fixes: containers#5553 Signed-off-by: Brent Baude <[email protected]>
thanks for the great report and reproducers. it makes things easier. |
snj33v
pushed a commit
to snj33v/libpod
that referenced
this issue
May 31, 2020
honor -1 in in list containers for compatibility mode. it is commonly used to indicate no limit. change the json id parameter to Id in container create. Fixes: containers#5553 Signed-off-by: Brent Baude <[email protected]>
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
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.
/kind bug
Description
I'm trying to make the SaltStack Docker driver work with Podman APIv2 (the driver uses
docker-py
under the hood).I managed to run simple Salt commands like
docker.version
,docker.info
anddocker.pull
, but more complex ones likedocker.ps
ordocker.run_container
are failing. I traced the failures back to the underlying APIv2 calls that aren't compatible with Docker API:sudo curl --unix-socket /run/podman/podman.sock http://d/version
It reports
"Version":"1.8.1"
, but the Salt module expects at least1.9.0
to decide if it should work at all. The problem is arguable and can be fixed on Salt side by checking forPodman Engine
component name. However, I decided to report it anyway because other tools in the wild can also make some decisions based on the version number.sudo curl --unix-socket /run/podman/podman.sock 'http://localhost/v1.40/containers/json?limit=-1&all=1&size=0&trunc_cmd=0'
{"cause":"runtime error: slice bounds out of range","message":"runtime error: slice bounds out of range","response":500}
This problem is caused by the
limit=-1
default parameter forcontainers()
in docker-py: https://github.com/docker/docker-py/blob/master/docker/api/container.py#L151-L153Docker API spec doesn't list
-1
as a valid number https://docs.docker.com/engine/api/v1.40/#tag/Container However, other calls use it, so I guess it is a common convention:sudo curl --unix-socket /run/podman/podman.sock --header "Content-Type: application/json" --data '{"Tty": false, "OpenStdin": false, "StdinOnce": false, "AttachStdin": false, "AttachStdout": true, "AttachStderr": true, "Image": "72300a873c2ca11c70d0c8642177ce76ff69ae04d61a5813ef58d40ff66e3e7c", "NetworkDisabled": false, "HostConfig": {"NetworkMode": "default"}}' 'http://localhost/v1.40/containers/create?name=ubuntu'
It returns the following response
{"id":"d3dfc6dcd2b5bff7b6a54dd3fc06a338ab2e28bb4ece1c7aee8ef51a5579f997","Warnings":[]}
The problem here is that the
id
key is lowercase. I believe it should beId
instead:Salt driver uses
Id
in multiple places and crashes because it can't find the key.I guess there are other problems, but those are the first roadblocks I noticed. I'm willing to invest more time to test the new APIv2 when/if they are fixed.
Output of
podman version
:docker-py version:
Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):The text was updated successfully, but these errors were encountered: