From ad80bfd0693f61df5bf46a4ba2dbb0a87d3fe6f9 Mon Sep 17 00:00:00 2001 From: Jianghua Wang Date: Thu, 1 Feb 2018 10:19:40 +0000 Subject: 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 --- kolla/tests/test_build.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'kolla/tests') 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): -- cgit v1.2.3