summaryrefslogtreecommitdiff
path: root/kolla/tests
diff options
context:
space:
mode:
authorJianghua Wang <jianghua.wang@citrix.com>2018-02-01 10:19:40 +0000
committerJianghua Wang <jianghua.wang@citrix.com>2018-02-03 02:58:12 +0000
commitad80bfd0693f61df5bf46a4ba2dbb0a87d3fe6f9 (patch)
treea23edbbf94d7289c66ffbcf7415467cdf73693b3 /kolla/tests
parent27557d2e77dd56b04d20d290e4ebb340398e7cdd (diff)
downloadkolla-ad80bfd0693f61df5bf46a4ba2dbb0a87d3fe6f9.tar.gz
kolla-ad80bfd0693f61df5bf46a4ba2dbb0a87d3fe6f9.zip
Remove the unsupported 'insecure_registry' for >=docker 3.0.0
The argument of 'insecure_registry' for image push has been removed by this commit (in docker 3.0.0): https://github.com/docker/docker-py/commit/b180b8770a265e33099bd6da76c3e556a1028491 Actually this argument was marked as deprecated and unfunctional before this removing. This commit is to remove this parameter at invoking the push() function when docker version >= 3.0.0. Change-Id: Ifa7d304d08a4073dcb1dff751d5a443c112cd377 Closes-Bug: #1746703
Diffstat (limited to 'kolla/tests')
-rw-r--r--kolla/tests/test_build.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py
index b7aa0c29e..be2dce7e9 100644
--- a/kolla/tests/test_build.py
+++ b/kolla/tests/test_build.py
@@ -57,15 +57,26 @@ class TasksTest(base.TestCase):
self.imageChild.parent = self.image
self.imageChild.path = self.useFixture(fixtures.TempDir()).path
+ @mock.patch('docker.version', '2.7.0')
@mock.patch.dict(os.environ, clear=True)
@mock.patch('docker.APIClient')
- def test_push_image(self, mock_client):
+ def test_push_image_before_v3_0_0(self, mock_client):
self.dc = mock_client
pusher = build.PushTask(self.conf, self.image)
pusher.run()
mock_client().push.assert_called_once_with(
self.image.canonical_name, stream=True, insecure_registry=True)
+ @mock.patch('docker.version', '3.0.0')
+ @mock.patch.dict(os.environ, clear=True)
+ @mock.patch('docker.APIClient')
+ def test_push_image(self, mock_client):
+ self.dc = mock_client
+ pusher = build.PushTask(self.conf, self.image)
+ pusher.run()
+ mock_client().push.assert_called_once_with(
+ self.image.canonical_name, stream=True)
+
@mock.patch.dict(os.environ, clear=True)
@mock.patch('docker.APIClient')
def test_build_image(self, mock_client):