From aaf46be238f554148b40748dbd4eafec759038ed Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Mon, 30 Oct 2017 10:28:51 +1300 Subject: [PATCH] Finish deprecation of pull_source In change I0b0b8728b7752bdd4680a5a2bbf664f94f7d56d9 the --pull-source argument was deprecated in favour of a --namespace which includes the source registry. This change makes the default namespace docker.io/tripleoupstream to be consistent with the default that the CLI uses. Tests now do not use pull_source so that proper testing of fully qualified namespace arguments is done. Change-Id: Icd29f0e75c3edadfb008056af774e283200002b0 Related-Bug: #1708303 --- container-images/overcloud_containers.yaml | 190 +++++++++--------- tripleo_common/image/kolla_builder.py | 2 +- tripleo_common/tests/image/fakes.py | 20 +- .../tests/image/test_image_uploader.py | 74 ++----- .../tests/image/test_kolla_builder.py | 110 +++++----- 5 files changed, 178 insertions(+), 218 deletions(-) diff --git a/container-images/overcloud_containers.yaml b/container-images/overcloud_containers.yaml index 5aa3e8f76..f603414e8 100644 --- a/container-images/overcloud_containers.yaml +++ b/container-images/overcloud_containers.yaml @@ -1,97 +1,97 @@ container_images: -- imagename: tripleoupstream/centos-binary-aodh-api:latest -- imagename: tripleoupstream/centos-binary-aodh-evaluator:latest -- imagename: tripleoupstream/centos-binary-aodh-listener:latest -- imagename: tripleoupstream/centos-binary-aodh-notifier:latest -- imagename: tripleoupstream/centos-binary-barbican-api:latest -- imagename: tripleoupstream/centos-binary-barbican-keystone-listener:latest -- imagename: tripleoupstream/centos-binary-barbican-worker:latest -- imagename: tripleoupstream/centos-binary-ceilometer-central:latest -- imagename: tripleoupstream/centos-binary-ceilometer-compute:latest -- imagename: tripleoupstream/centos-binary-ceilometer-notification:latest -- imagename: tripleoupstream/centos-binary-ceilometer-ipmi:latest -- imagename: tripleoupstream/centos-binary-cinder-api:latest -- imagename: tripleoupstream/centos-binary-cinder-backup:latest -- imagename: tripleoupstream/centos-binary-cinder-scheduler:latest -- imagename: tripleoupstream/centos-binary-cinder-volume:latest -- imagename: tripleoupstream/centos-binary-collectd:latest -- imagename: tripleoupstream/centos-binary-congress-api:latest -- imagename: tripleoupstream/centos-binary-cron:latest -- imagename: tripleoupstream/centos-binary-ec2-api:latest -- imagename: tripleoupstream/centos-binary-etcd:latest -- imagename: tripleoupstream/centos-binary-fluentd:latest -- imagename: tripleoupstream/centos-binary-glance-api:latest -- imagename: tripleoupstream/centos-binary-gnocchi-api:latest -- imagename: tripleoupstream/centos-binary-gnocchi-metricd:latest -- imagename: tripleoupstream/centos-binary-gnocchi-statsd:latest -- imagename: tripleoupstream/centos-binary-haproxy:latest -- imagename: tripleoupstream/centos-binary-heat-all:latest -- imagename: tripleoupstream/centos-binary-heat-api-cfn:latest -- imagename: tripleoupstream/centos-binary-heat-api:latest -- imagename: tripleoupstream/centos-binary-heat-engine:latest -- imagename: tripleoupstream/centos-binary-horizon:latest -- imagename: tripleoupstream/centos-binary-ironic-api:latest -- imagename: tripleoupstream/centos-binary-ironic-conductor:latest -- imagename: tripleoupstream/centos-binary-ironic-inspector:latest -- imagename: tripleoupstream/centos-binary-ironic-pxe:latest -- imagename: tripleoupstream/centos-binary-iscsid:latest -- imagename: tripleoupstream/centos-binary-keystone:latest -- imagename: tripleoupstream/centos-binary-manila-api:latest -- imagename: tripleoupstream/centos-binary-manila-base:latest -- imagename: tripleoupstream/centos-binary-manila-scheduler:latest -- imagename: tripleoupstream/centos-binary-manila-share:latest -- imagename: tripleoupstream/centos-binary-mariadb:latest -- imagename: tripleoupstream/centos-binary-memcached:latest -- imagename: tripleoupstream/centos-binary-mistral-api:latest -- imagename: tripleoupstream/centos-binary-mistral-engine:latest -- imagename: tripleoupstream/centos-binary-mistral-executor:latest -- imagename: tripleoupstream/centos-binary-mistral-event-engine:latest -- imagename: tripleoupstream/centos-binary-mongodb:latest -- imagename: tripleoupstream/centos-binary-multipathd:latest -- imagename: tripleoupstream/centos-binary-neutron-dhcp-agent:latest -- imagename: tripleoupstream/centos-binary-neutron-l3-agent:latest -- imagename: tripleoupstream/centos-binary-neutron-metadata-agent:latest -- imagename: tripleoupstream/centos-binary-neutron-openvswitch-agent:latest -- imagename: tripleoupstream/centos-binary-neutron-sriov-agent:latest -- imagename: tripleoupstream/centos-binary-neutron-server:latest -- imagename: tripleoupstream/centos-binary-neutron-server-opendaylight:latest -- imagename: tripleoupstream/centos-binary-neutron-server-ovn:latest -- imagename: tripleoupstream/centos-binary-nova-api:latest -- imagename: tripleoupstream/centos-binary-nova-compute-ironic:latest -- imagename: tripleoupstream/centos-binary-nova-compute:latest -- imagename: tripleoupstream/centos-binary-nova-conductor:latest -- imagename: tripleoupstream/centos-binary-nova-consoleauth:latest -- imagename: tripleoupstream/centos-binary-nova-libvirt:latest -- imagename: tripleoupstream/centos-binary-nova-novncproxy:latest -- imagename: tripleoupstream/centos-binary-nova-placement-api:latest -- imagename: tripleoupstream/centos-binary-nova-scheduler:latest -- imagename: tripleoupstream/centos-binary-novajoin-notifier:latest -- imagename: tripleoupstream/centos-binary-novajoin-server:latest -- imagename: tripleoupstream/centos-binary-octavia-base:latest -- imagename: tripleoupstream/centos-binary-octavia-api:latest -- imagename: tripleoupstream/centos-binary-octavia-health-manager:latest -- imagename: tripleoupstream/centos-binary-octavia-housekeeping:latest -- imagename: tripleoupstream/centos-binary-octavia-worker:latest -- imagename: tripleoupstream/centos-binary-opendaylight:latest -- imagename: tripleoupstream/centos-binary-ovn-base:latest -- imagename: tripleoupstream/centos-binary-ovn-controller:latest -- imagename: tripleoupstream/centos-binary-ovn-nb-db-server:latest -- imagename: tripleoupstream/centos-binary-ovn-northd:latest -- imagename: tripleoupstream/centos-binary-ovn-sb-db-server:latest -- imagename: tripleoupstream/centos-binary-panko-api:latest -- imagename: tripleoupstream/centos-binary-qdrouterd:latest -- imagename: tripleoupstream/centos-binary-rabbitmq:latest -- imagename: tripleoupstream/centos-binary-redis:latest -- imagename: tripleoupstream/centos-binary-sahara-api:latest -- imagename: tripleoupstream/centos-binary-sahara-engine:latest -- imagename: tripleoupstream/centos-binary-sensu-client:latest -- imagename: tripleoupstream/centos-binary-skydive-agent:latest -- imagename: tripleoupstream/centos-binary-skydive-analyzer:latest -- imagename: tripleoupstream/centos-binary-swift-account:latest -- imagename: tripleoupstream/centos-binary-swift-container:latest -- imagename: tripleoupstream/centos-binary-swift-object:latest -- imagename: tripleoupstream/centos-binary-swift-proxy-server:latest -- imagename: tripleoupstream/centos-binary-tacker:latest -- imagename: tripleoupstream/centos-binary-zaqar:latest +- imagename: docker.io/tripleoupstream/centos-binary-aodh-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-aodh-evaluator:latest +- imagename: docker.io/tripleoupstream/centos-binary-aodh-listener:latest +- imagename: docker.io/tripleoupstream/centos-binary-aodh-notifier:latest +- imagename: docker.io/tripleoupstream/centos-binary-barbican-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-barbican-keystone-listener:latest +- imagename: docker.io/tripleoupstream/centos-binary-barbican-worker:latest +- imagename: docker.io/tripleoupstream/centos-binary-ceilometer-central:latest +- imagename: docker.io/tripleoupstream/centos-binary-ceilometer-compute:latest +- imagename: docker.io/tripleoupstream/centos-binary-ceilometer-notification:latest +- imagename: docker.io/tripleoupstream/centos-binary-ceilometer-ipmi:latest +- imagename: docker.io/tripleoupstream/centos-binary-cinder-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-cinder-backup:latest +- imagename: docker.io/tripleoupstream/centos-binary-cinder-scheduler:latest +- imagename: docker.io/tripleoupstream/centos-binary-cinder-volume:latest +- imagename: docker.io/tripleoupstream/centos-binary-collectd:latest +- imagename: docker.io/tripleoupstream/centos-binary-congress-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-cron:latest +- imagename: docker.io/tripleoupstream/centos-binary-ec2-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-etcd:latest +- imagename: docker.io/tripleoupstream/centos-binary-fluentd:latest +- imagename: docker.io/tripleoupstream/centos-binary-glance-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-gnocchi-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-gnocchi-metricd:latest +- imagename: docker.io/tripleoupstream/centos-binary-gnocchi-statsd:latest +- imagename: docker.io/tripleoupstream/centos-binary-haproxy:latest +- imagename: docker.io/tripleoupstream/centos-binary-heat-all:latest +- imagename: docker.io/tripleoupstream/centos-binary-heat-api-cfn:latest +- imagename: docker.io/tripleoupstream/centos-binary-heat-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-heat-engine:latest +- imagename: docker.io/tripleoupstream/centos-binary-horizon:latest +- imagename: docker.io/tripleoupstream/centos-binary-ironic-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-ironic-conductor:latest +- imagename: docker.io/tripleoupstream/centos-binary-ironic-inspector:latest +- imagename: docker.io/tripleoupstream/centos-binary-ironic-pxe:latest +- imagename: docker.io/tripleoupstream/centos-binary-iscsid:latest +- imagename: docker.io/tripleoupstream/centos-binary-keystone:latest +- imagename: docker.io/tripleoupstream/centos-binary-manila-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-manila-base:latest +- imagename: docker.io/tripleoupstream/centos-binary-manila-scheduler:latest +- imagename: docker.io/tripleoupstream/centos-binary-manila-share:latest +- imagename: docker.io/tripleoupstream/centos-binary-mariadb:latest +- imagename: docker.io/tripleoupstream/centos-binary-memcached:latest +- imagename: docker.io/tripleoupstream/centos-binary-mistral-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-mistral-engine:latest +- imagename: docker.io/tripleoupstream/centos-binary-mistral-executor:latest +- imagename: docker.io/tripleoupstream/centos-binary-mistral-event-engine:latest +- imagename: docker.io/tripleoupstream/centos-binary-mongodb:latest +- imagename: docker.io/tripleoupstream/centos-binary-multipathd:latest +- imagename: docker.io/tripleoupstream/centos-binary-neutron-dhcp-agent:latest +- imagename: docker.io/tripleoupstream/centos-binary-neutron-l3-agent:latest +- imagename: docker.io/tripleoupstream/centos-binary-neutron-metadata-agent:latest +- imagename: docker.io/tripleoupstream/centos-binary-neutron-openvswitch-agent:latest +- imagename: docker.io/tripleoupstream/centos-binary-neutron-sriov-agent:latest +- imagename: docker.io/tripleoupstream/centos-binary-neutron-server:latest +- imagename: docker.io/tripleoupstream/centos-binary-neutron-server-opendaylight:latest +- imagename: docker.io/tripleoupstream/centos-binary-neutron-server-ovn:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-compute-ironic:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-compute:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-conductor:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-consoleauth:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-libvirt:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-novncproxy:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-placement-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-nova-scheduler:latest +- imagename: docker.io/tripleoupstream/centos-binary-novajoin-notifier:latest +- imagename: docker.io/tripleoupstream/centos-binary-novajoin-server:latest +- imagename: docker.io/tripleoupstream/centos-binary-octavia-base:latest +- imagename: docker.io/tripleoupstream/centos-binary-octavia-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-octavia-health-manager:latest +- imagename: docker.io/tripleoupstream/centos-binary-octavia-housekeeping:latest +- imagename: docker.io/tripleoupstream/centos-binary-octavia-worker:latest +- imagename: docker.io/tripleoupstream/centos-binary-opendaylight:latest +- imagename: docker.io/tripleoupstream/centos-binary-ovn-base:latest +- imagename: docker.io/tripleoupstream/centos-binary-ovn-controller:latest +- imagename: docker.io/tripleoupstream/centos-binary-ovn-nb-db-server:latest +- imagename: docker.io/tripleoupstream/centos-binary-ovn-northd:latest +- imagename: docker.io/tripleoupstream/centos-binary-ovn-sb-db-server:latest +- imagename: docker.io/tripleoupstream/centos-binary-panko-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-qdrouterd:latest +- imagename: docker.io/tripleoupstream/centos-binary-rabbitmq:latest +- imagename: docker.io/tripleoupstream/centos-binary-redis:latest +- imagename: docker.io/tripleoupstream/centos-binary-sahara-api:latest +- imagename: docker.io/tripleoupstream/centos-binary-sahara-engine:latest +- imagename: docker.io/tripleoupstream/centos-binary-sensu-client:latest +- imagename: docker.io/tripleoupstream/centos-binary-skydive-agent:latest +- imagename: docker.io/tripleoupstream/centos-binary-skydive-analyzer:latest +- imagename: docker.io/tripleoupstream/centos-binary-swift-account:latest +- imagename: docker.io/tripleoupstream/centos-binary-swift-container:latest +- imagename: docker.io/tripleoupstream/centos-binary-swift-object:latest +- imagename: docker.io/tripleoupstream/centos-binary-swift-proxy-server:latest +- imagename: docker.io/tripleoupstream/centos-binary-tacker:latest +- imagename: docker.io/tripleoupstream/centos-binary-zaqar:latest - imagename: docker.io/ceph/daemon:tag-stable-3.0-luminous-centos-7 -- imagename: tripleoupstream/centos-binary-rsyslog-base:latest +- imagename: docker.io/tripleoupstream/centos-binary-rsyslog-base:latest diff --git a/tripleo_common/image/kolla_builder.py b/tripleo_common/image/kolla_builder.py index 443c571d3..8723e4616 100644 --- a/tripleo_common/image/kolla_builder.py +++ b/tripleo_common/image/kolla_builder.py @@ -26,7 +26,7 @@ from tripleo_common.image import base CONTAINER_IMAGES_DEFAULTS = { - 'namespace': 'tripleoupstream', + 'namespace': 'docker.io/tripleoupstream', 'ceph_namespace': 'docker.io/ceph', 'ceph_image': 'daemon', 'ceph_tag': 'tag-stable-3.0-luminous-centos-7', diff --git a/tripleo_common/tests/image/fakes.py b/tripleo_common/tests/image/fakes.py index d23d42cd0..8e5906a43 100644 --- a/tripleo_common/tests/image/fakes.py +++ b/tripleo_common/tests/image/fakes.py @@ -29,17 +29,17 @@ def create_disk_images(): def create_parsed_upload_images(): uploads = [ - {'imagename': 'tripleoupstream/heat-docker-agents-centos:latest', + {'imagename': 'docker.io/tripleoupstream/' + 'heat-docker-agents-centos:latest', 'push_destination': 'localhost:8787'}, - {'imagename': 'tripleoupstream/centos-binary-nova-compute:liberty', - 'push_destination': 'localhost:8787', - 'pull_source': 'docker.io', - 'uploader': 'docker'}, - {'imagename': 'tripleoupstream/centos-binary-nova-libvirt:liberty', - 'push_destination': 'localhost:8787', - 'pull_source': 'docker.io', - 'uploader': 'docker'}, - {'imagename': 'tripleoupstream/image-with-missing-tag', + {'imagename': 'docker.io/tripleoupstream/' + 'centos-binary-nova-compute:liberty', + 'push_destination': 'localhost:8787'}, + {'imagename': 'docker.io/tripleoupstream/' + 'centos-binary-nova-libvirt:liberty', + 'push_destination': 'localhost:8787'}, + {'imagename': 'docker.io/tripleoupstream/' + 'image-with-missing-tag', 'push_destination': 'localhost:8787'}, ] return uploads diff --git a/tripleo_common/tests/image/test_image_uploader.py b/tripleo_common/tests/image/test_image_uploader.py index ecbb4fe1c..e48942ab1 100644 --- a/tripleo_common/tests/image/test_image_uploader.py +++ b/tripleo_common/tests/image/test_image_uploader.py @@ -28,31 +28,12 @@ from tripleo_common.tests.image import fakes filedata = six.u( """container_images: - - imagename: tripleoupstream/heat-docker-agents-centos:latest + - imagename: docker.io/tripleoupstream/heat-docker-agents-centos:latest push_destination: localhost:8787 - - imagename: tripleoupstream/centos-binary-nova-compute:liberty - uploader: docker - pull_source: docker.io + - imagename: docker.io/tripleoupstream/centos-binary-nova-compute:liberty push_destination: localhost:8787 - - imagename: tripleoupstream/centos-binary-nova-libvirt:liberty - uploader: docker - pull_source: docker.io - - imagename: tripleoupstream/image-with-missing-tag - push_destination: localhost:8787 -""") - -legacy_filedata = six.u( - """uploads: - - imagename: tripleoupstream/heat-docker-agents-centos:latest - push_destination: localhost:8787 - - imagename: tripleoupstream/centos-binary-nova-compute:liberty - uploader: docker - pull_source: docker.io - push_destination: localhost:8787 - - imagename: tripleoupstream/centos-binary-nova-libvirt:liberty - uploader: docker - pull_source: docker.io - - imagename: tripleoupstream/image-with-missing-tag + - imagename: docker.io/tripleoupstream/centos-binary-nova-libvirt:liberty + - imagename: docker.io/tripleoupstream/image-with-missing-tag push_destination: localhost:8787 """) @@ -82,23 +63,6 @@ class TestImageUploadManager(base.TestCase): key=operator.itemgetter('imagename')) self.assertEqual(sorted_expected_data, sorted_parsed_data) - @mock.patch('tripleo_common.image.base.open', - mock.mock_open(read_data=legacy_filedata), create=True) - @mock.patch('os.path.isfile', return_value=True) - @mock.patch('fcntl.ioctl', side_effect=Exception) - @mock.patch('tripleo_common.image.image_uploader.Client') - def test_legacy_file_parsing(self, mockpath, mockioctl, mockdocker): - manager = ImageUploadManager(self.filelist, debug=True) - parsed_data = manager.upload() - mockpath(self.filelist[0]) - - expected_data = fakes.create_parsed_upload_images() - sorted_expected_data = sorted(expected_data, - key=operator.itemgetter('imagename')) - sorted_parsed_data = sorted(parsed_data, - key=operator.itemgetter('imagename')) - self.assertEqual(sorted_expected_data, sorted_parsed_data) - class TestImageUploader(base.TestCase): @@ -127,51 +91,49 @@ class TestDockerImageUploader(base.TestCase): self.patcher.stop() def test_upload_image(self): - image = 'tripleoupstream/heat-docker-agents-centos' + image = 'docker.io/tripleoupstream/heat-docker-agents-centos' tag = 'latest' - pull_source = 'docker.io' push_destination = 'localhost:8787' + push_image = 'localhost:8787/tripleoupstream/heat-docker-agents-centos' self.uploader.upload_image(image + ':' + tag, - pull_source, + None, push_destination) self.dockermock.assert_called_once_with( base_url='unix://var/run/docker.sock', version='auto') self.dockermock.return_value.pull.assert_called_once_with( - pull_source + '/' + image, - tag=tag, stream=True) + image, tag=tag, stream=True) self.dockermock.return_value.tag.assert_called_once_with( - image=pull_source + '/' + image + ':' + tag, - repository=push_destination + '/' + image, + image=image + ':' + tag, + repository=push_image, tag=tag, force=True) self.dockermock.return_value.push( - push_destination + '/' + image, + push_image, tag=tag, stream=True) def test_upload_image_missing_tag(self): - image = 'tripleoupstream/heat-docker-agents-centos' + image = 'docker.io/tripleoupstream/heat-docker-agents-centos' expected_tag = 'latest' - pull_source = 'docker.io' push_destination = 'localhost:8787' + push_image = 'localhost:8787/tripleoupstream/heat-docker-agents-centos' self.uploader.upload_image(image, - pull_source, + None, push_destination) self.dockermock.assert_called_once_with( base_url='unix://var/run/docker.sock', version='auto') self.dockermock.return_value.pull.assert_called_once_with( - pull_source + '/' + image, - tag=expected_tag, stream=True) + image, tag=expected_tag, stream=True) self.dockermock.return_value.tag.assert_called_once_with( - image=pull_source + '/' + image + ':' + expected_tag, - repository=push_destination + '/' + image, + image=image + ':' + expected_tag, + repository=push_image, tag=expected_tag, force=True) self.dockermock.return_value.push( - push_destination + '/' + image, + push_image, tag=expected_tag, stream=True) def test_discover_image_tag(self): diff --git a/tripleo_common/tests/image/test_kolla_builder.py b/tripleo_common/tests/image/test_kolla_builder.py index 14e590a33..9e5d57cc7 100644 --- a/tripleo_common/tests/image/test_kolla_builder.py +++ b/tripleo_common/tests/image/test_kolla_builder.py @@ -27,34 +27,26 @@ from tripleo_common.tests import base filedata = six.u("""container_images: -- imagename: tripleoupstream/heat-docker-agents-centos:latest +- imagename: docker.io/tripleoupstream/heat-docker-agents-centos:latest push_destination: localhost:8787 -- imagename: tripleoupstream/centos-binary-nova-compute:liberty +- imagename: docker.io/tripleoupstream/centos-binary-nova-compute:liberty uploader: docker - pull_source: docker.io push_destination: localhost:8787 -- imagename: tripleoupstream/centos-binary-nova-libvirt:liberty +- imagename: docker.io/tripleoupstream/centos-binary-nova-libvirt:liberty uploader: docker - pull_source: docker.io -- imagename: tripleoupstream/image-with-missing-tag +- imagename: docker.io/tripleoupstream/image-with-missing-tag push_destination: localhost:8787 """) template_filedata = six.u(""" -{% set namespace=namespace or "tripleoupstream" %} -{% set name_prefix=name_prefix or "centos-binary-" %} -{% set name_suffix=name_suffix or "" %} -{% set tag=tag or "latest" %} container_images_template: - imagename: "{{namespace}}/heat-docker-agents-centos:latest" push_destination: "{{push_destination}}" - imagename: "{{namespace}}/{{name_prefix}}nova-compute{{name_suffix}}:{{tag}}" uploader: "docker" - pull_source: "{{pull_source}}" push_destination: "{{push_destination}}" - imagename: "{{namespace}}/{{name_prefix}}nova-libvirt{{name_suffix}}:{{tag}}" uploader: "docker" - pull_source: "{{pull_source}}" - imagename: "{{namespace}}/image-with-missing-tag" push_destination: "{{push_destination}}" """) @@ -147,7 +139,6 @@ class TestKollaImageBuilderTemplate(base.TestCase): def test_container_images_from_template(self): builder = kb.KollaImageBuilder(self.filelist) result = builder.container_images_from_template( - pull_source='docker.io', push_destination='localhost:8787', tag='liberty' ) @@ -165,7 +156,7 @@ class TestKollaImageBuilderTemplate(base.TestCase): self.assertEqual( { - 'namespace': 'tripleoupstream', + 'namespace': 'docker.io/tripleoupstream', 'ceph_namespace': 'docker.io/ceph', 'ceph_image': 'daemon', 'ceph_tag': 'tag-stable-3.0-luminous-centos-7', @@ -180,7 +171,7 @@ class TestKollaImageBuilderTemplate(base.TestCase): self.assertEqual( { - 'namespace': 'docker.io/tripleoupstream', + 'namespace': '192.0.2.0:5000/tripleoupstream', 'ceph_namespace': 'docker.io/cephh', 'ceph_image': 'ceph-daemon', 'ceph_tag': 'latest', @@ -191,7 +182,7 @@ class TestKollaImageBuilderTemplate(base.TestCase): 'neutron_driver': 'ovn' }, builder.container_images_template_inputs( - namespace='docker.io/tripleoupstream', + namespace='192.0.2.0:5000/tripleoupstream', ceph_namespace='docker.io/cephh', ceph_image='ceph-daemon', ceph_tag='latest', @@ -213,7 +204,6 @@ class TestKollaImageBuilderTemplate(base.TestCase): return # set source and destination on all entries - entry['pull_source'] = 'docker.io' entry['push_destination'] = 'localhost:8787' return entry @@ -222,18 +212,17 @@ class TestKollaImageBuilderTemplate(base.TestCase): tag='liberty' ) container_images = [{ - 'imagename': 'tripleoupstream/centos-binary-nova-compute:liberty', - 'pull_source': 'docker.io', + 'imagename': 'docker.io/tripleoupstream/' + 'centos-binary-nova-compute:liberty', 'push_destination': 'localhost:8787', 'uploader': 'docker' }, { - 'imagename': 'tripleoupstream/centos-binary-nova-libvirt:liberty', - 'pull_source': 'docker.io', + 'imagename': 'docker.io/tripleoupstream/' + 'centos-binary-nova-libvirt:liberty', 'push_destination': 'localhost:8787', 'uploader': 'docker' }, { - 'imagename': 'tripleoupstream/image-with-missing-tag', - 'pull_source': 'docker.io', + 'imagename': 'docker.io/tripleoupstream/image-with-missing-tag', 'push_destination': 'localhost:8787' }] self.assertEqual(container_images, result) @@ -276,71 +265,80 @@ class TestKollaImageBuilderTemplate(base.TestCase): def test_container_images_yaml_in_sync(self): remove_images = [ - {'imagename': 'tripleoupstream/centos-binary' + {'imagename': 'docker.io/tripleoupstream/centos-binary' '-neutron-server-opendaylight:latest'}, - {'imagename': 'tripleoupstream/centos-binary' + {'imagename': 'docker.io/tripleoupstream/centos-binary' '-neutron-server-ovn:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-base:latest'}, - {'imagename': 'tripleoupstream/centos-binary' + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-ovn-base:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary' '-opendaylight:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-northd:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-ovn-northd:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'controller:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'nb-db-server:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'sb-db-server:latest'}, - {'imagename': 'tripleoupstream/centos-binary-rsyslog-base:latest'}] + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-rsyslog-base:latest'}] self._test_container_images_yaml_in_sync_helper( remove_images=remove_images) def test_container_images_yaml_in_sync_for_odl(self): # remove neutron-server image reference from overcloud_containers.yaml remove_images = [ - {'imagename': 'tripleoupstream/centos-binary' + {'imagename': 'docker.io/tripleoupstream/centos-binary' '-neutron-server:latest'}, - {'imagename': 'tripleoupstream/centos-binary' + {'imagename': 'docker.io/tripleoupstream/centos-binary' '-neutron-server-ovn:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-base:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-northd:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-ovn-base:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-ovn-northd:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'controller:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'nb-db-server:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'sb-db-server:latest'}, - {'imagename': 'tripleoupstream/centos-binary-rsyslog-base:latest'}] + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-rsyslog-base:latest'}] self._test_container_images_yaml_in_sync_helper( neutron_driver='odl', remove_images=remove_images) def test_container_images_yaml_in_sync_for_ovn(self): # remove neutron-server image reference from overcloud_containers.yaml - remove_images = [{'imagename': 'tripleoupstream/centos-binary' - '-neutron-server:latest'}, - {'imagename': 'tripleoupstream/centos-binary' - '-neutron-server-opendaylight:latest'}, - {'imagename': 'tripleoupstream/centos-binary' - '-opendaylight:latest'}, - {'imagename': 'tripleoupstream/centos-binary' - '-rsyslog-base:latest'}] + remove_images = [ + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-neutron-server:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-neutron-server-opendaylight:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-opendaylight:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-rsyslog-base:latest'}] self._test_container_images_yaml_in_sync_helper( neutron_driver='ovn', remove_images=remove_images) def test_container_images_yaml_in_sync_for_stdout_logging(self): remove_images = [ - {'imagename': 'tripleoupstream/centos-binary' + {'imagename': 'docker.io/tripleoupstream/centos-binary' '-neutron-server-opendaylight:latest'}, - {'imagename': 'tripleoupstream/centos-binary' + {'imagename': 'docker.io/tripleoupstream/centos-binary' '-neutron-server-ovn:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-base:latest'}, - {'imagename': 'tripleoupstream/centos-binary' + {'imagename': 'docker.io/tripleoupstream/centos-binary' + '-ovn-base:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary' '-opendaylight:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-northd:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' + 'northd:latest'}, + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'controller:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'nb-db-server:latest'}, - {'imagename': 'tripleoupstream/centos-binary-ovn-' + {'imagename': 'docker.io/tripleoupstream/centos-binary-ovn-' 'sb-db-server:latest'}] self._test_container_images_yaml_in_sync_helper( remove_images=remove_images, logging='stdout')