mirror of
https://github.com/containers/podman.git
synced 2026-10-05 01:36:25 -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:
1 parent
5685ac5952
commit
56e555bfc2
216 files changed
+1734
-11497
No files matched your search
@@ -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