api/compat: switch to moby/moby

Replace github.com/docker/docker API imports with github.com/moby/moby
across compat handlers, swagger models, and tests to align with upstream
type definitions.

Fixes: #27536.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
Jan Kaluza
2026-02-10 13:35:31 +01:00
parent 5685ac5952
commit 56e555bfc2
216 changed files with 1734 additions and 11497 deletions

View File

@@ -0,0 +1,6 @@
package compat
// We import `moby/moby/api` here to pull-in vendor/github.com/moby/moby/api/swagger.yaml.
// It is used by our tests and without using it from some .go file, the `go mod vendor`
// will not pull it in.
import _ "github.com/moby/moby/api"

View File

@@ -311,12 +311,12 @@ class TestContainers(common.DockerTestCase):
def test_container_inspect_compatibility(self):
"""Test container inspect result compatibility with DOCKER_API.
When upgrading module "github.com/docker/docker" this test might fail, if so please correct podman inspect
When upgrading module "github.com/moby/moby" this test might fail, if so please correct podman inspect
command result to stay compatible with docker.
"""
ctr = self.docker.containers.create(image="alpine", detach=True)
try:
spec = yaml.load(open("vendor/github.com/docker/docker/api/swagger.yaml").read(), Loader=yaml.Loader)
spec = yaml.load(open("vendor/github.com/moby/moby/api/swagger.yaml").read(), Loader=yaml.Loader)
ctr_inspect = json.loads(self.podman.run("inspect", ctr.id).stdout)[0]
schema = spec['paths']["/containers/{id}/json"]["get"]['responses'][200]['schema']
schema["definitions"] = spec["definitions"]