diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-12-18 11:44:19 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2018-12-21 15:59:34 -0500 |
commit | c657dc4fdbca4b331d69e0910261e2cb11e2a629 (patch) | |
tree | fa75b6ecfbaf7c3c85ab7548fe1ac29d1612cf47 /contrib | |
parent | fe186c6ebba95db89463f38c6aa0f0dcc104a249 (diff) | |
download | podman-c657dc4fdbca4b331d69e0910261e2cb11e2a629.tar.gz podman-c657dc4fdbca4b331d69e0910261e2cb11e2a629.tar.bz2 podman-c657dc4fdbca4b331d69e0910261e2cb11e2a629.zip |
Switch all referencs to image.ContainerConfig to image.Config
This will more closely match what Docker is doing.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/python/podman/podman/libs/images.py | 4 | ||||
-rw-r--r-- | contrib/python/podman/test/test_containers.py | 18 | ||||
-rw-r--r-- | contrib/python/podman/test/test_images.py | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/contrib/python/podman/podman/libs/images.py b/contrib/python/podman/podman/libs/images.py index ae1b86390..29ebe2c0f 100644 --- a/contrib/python/podman/podman/libs/images.py +++ b/contrib/python/podman/podman/libs/images.py @@ -41,8 +41,8 @@ class Image(collections.UserDict): details = self.inspect() config = ConfigDict(image_id=self._id, **kwargs) - config['command'] = details.containerconfig.get('cmd') - config['env'] = self._split_token(details.containerconfig.get('env')) + config['command'] = details.config.get('cmd') + config['env'] = self._split_token(details.config.get('env')) config['image'] = copy.deepcopy(details.repotags[0]) config['labels'] = copy.deepcopy(details.labels) config['net_mode'] = 'bridge' diff --git a/contrib/python/podman/test/test_containers.py b/contrib/python/podman/test/test_containers.py index a7a6ac304..5201956e8 100644 --- a/contrib/python/podman/test/test_containers.py +++ b/contrib/python/podman/test/test_containers.py @@ -140,7 +140,7 @@ class TestContainers(PodmanTestCase): # TODO: Test for STOPSIGNAL when supported by OCI # TODO: Test for message when supported by OCI details = self.pclient.images.get(self.alpine_ctnr.image).inspect() - changes = ['ENV=' + i for i in details.containerconfig['env']] + changes = ['ENV=' + i for i in details.config['env']] changes.append('CMD=/usr/bin/zsh') changes.append('ENTRYPOINT=/bin/sh date') changes.append('ENV=TEST=test_containers.TestContainers.test_commit') @@ -158,22 +158,22 @@ class TestContainers(PodmanTestCase): details = img.inspect() self.assertEqual(details.author, 'Bozo the clown') - self.assertListEqual(['/usr/bin/zsh'], details.containerconfig['cmd']) + self.assertListEqual(['/usr/bin/zsh'], details.config['cmd']) self.assertListEqual(['/bin/sh date'], - details.containerconfig['entrypoint']) + details.config['entrypoint']) self.assertIn('TEST=test_containers.TestContainers.test_commit', - details.containerconfig['env']) + details.config['env']) self.assertTrue( - [e for e in details.containerconfig['env'] if 'PATH=' in e]) + [e for e in details.config['env'] if 'PATH=' in e]) self.assertDictEqual({ '80': {}, '8888': {}, - }, details.containerconfig['exposedports']) + }, details.config['exposedports']) self.assertDictEqual({'unittest': 'test_commit'}, details.labels) - self.assertEqual('bozo:circus', details.containerconfig['user']) - self.assertEqual({'/data': {}}, details.containerconfig['volumes']) + self.assertEqual('bozo:circus', details.config['user']) + self.assertEqual({'/data': {}}, details.config['volumes']) self.assertEqual('/data/application', - details.containerconfig['workingdir']) + details.config['workingdir']) def test_remove(self): before = len(self.containers) diff --git a/contrib/python/podman/test/test_images.py b/contrib/python/podman/test/test_images.py index 45f0a2964..af6d4741e 100644 --- a/contrib/python/podman/test/test_images.py +++ b/contrib/python/podman/test/test_images.py @@ -69,7 +69,7 @@ class TestImages(PodmanTestCase): self.assertEqual(FoldedString(ctnr.status), 'running') ctnr_details = ctnr.inspect() - for e in img_details.containerconfig['env']: + for e in img_details.config['env']: self.assertIn(e, ctnr_details.config['env']) def test_export(self): |