mirror of
https://github.com/containers/podman.git
synced 2026-03-27 19:13:49 -04:00
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:
6
test/python/docker/compat/swagger.go
Normal file
6
test/python/docker/compat/swagger.go
Normal 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"
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user