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

/version API endpoint reports wrong ApiVersion and MinAPIVersion #7682

Closed
riyad opened this issue Sep 17, 2020 · 2 comments
Closed

/version API endpoint reports wrong ApiVersion and MinAPIVersion #7682

riyad opened this issue Sep 17, 2020 · 2 comments
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

@riyad
Copy link
Contributor

riyad commented Sep 17, 2020

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

/kind bug

Description

The REST API is supposed to be compatible with Docker's API version 1.40, but it reports version 1.0.0.
This trips up certain client libraries (most notably https://github.com/docker/docker-py and by extension Ansible) which currently require a minimum API version of 1.21.

Steps to reproduce the issue:

From the command line: curl -sv --unix-socket /run/podman/podman.sock http://localhost/version

With Python: pip3 install -U docker; python3

Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0] on linux
>>> import docker
>>> client = docker.APIClient(base_url='unix:///run/podman/podman.sock')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/docker/api/client.py", line 198, in __init__
    raise InvalidVersion(
docker.errors.InvalidVersion: API versions below 1.21 are no longer supported by this library.
>>> 

Describe the results you received:

The version endpoint returns the following data:

{
  "Platform": {
    "Name": "linux/amd64/fedora-32"
  },
  "Components": [
    {
      "Name": "Podman Engine",
      "Version": "2.0.6",
      "Details": {
        "APIVersion": "1.0.0",
        "Arch": "amd64",
        "BuildTime": "2020-09-01T19:26:51Z",
        "Experimental": "true",
        "GitCommit": "",
        "GoVersion": "go1.14.6",
        "KernelVersion": "5.4.0-47-generic",
        "MinAPIVersion": "1.0.0",
        "Os": "linux"
      }
    }
  ],
  "Version": "2.0.6",
  "ApiVersion": "1.0.0",
  "MinAPIVersion": "1.0.0",
  "GitCommit": "",
  "GoVersion": "go1.14.6",
  "Os": "linux",
  "Arch": "amd64",
  "KernelVersion": "5.4.0-47-generic",
  "Experimental": true,
  "BuildTime": "2020-09-01T19:26:51Z"
}

Describe the results you expected:

According to

DefaultAPIVersion = "1.40" // See https://docs.docker.com/engine/api/v1.40/
ApiVersion should be "1.40" and MinAPIVersion should be "1.24"

Output of podman version:

Version:      2.0.6
API Version:  1
Go Version:   go1.14.4
Built:        Thu Jan  1 00:00:00 1970
OS/Arch:      linux/amd64

Package info (e.g. output of rpm -q podman or apt list podman):

Installed on Ubuntu 20.04 LTS from OBS:

Listing... Done
podman/unknown,now 2.0.6~2 amd64 [installed]
podman/unknown 2.0.6~2 arm64
podman/unknown 2.0.6~2 armhf

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

2.0.6 is the latest sable release

Additional environment details (AWS, VirtualBox, physical, etc.):

Tested with

  • Ubuntu 20.04 LTS, Podman 2.0.6
  • Ubuntu 20.04 LTS, Podman 2.0.6 in LXD container
  • Fedora 32, Podman 2.0.6 in LXD container
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 17, 2020
@riyad riyad changed the title /version API endpoint reports wrong ApiVersion and MinAPIVersion /version API endpoint reports wrong ApiVersion and MinAPIVersion Sep 17, 2020
@jwhonce
Copy link
Member

jwhonce commented Sep 17, 2020

This was fixed in #7642

@jwhonce jwhonce closed this as completed Sep 17, 2020
@riyad
Copy link
Contributor Author

riyad commented Sep 19, 2020

Hah! ... awesome. 😄

@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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 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
Development

No branches or pull requests

3 participants