Update the default namespace

The container namespace has changed, this update modifies the client so
that it's now using a constant to set the namespace defaults.

Change-Id: I839298c177ef27852d0dcfc58cb7b62c161299c0
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2022-03-30 09:46:34 -05:00
parent ebe72e7056
commit ddb3525bcc
3 changed files with 11 additions and 13 deletions

View File

@ -40,7 +40,7 @@ EPHEMERAL_HEAT_POD_NAME = "ephemeral-heat"
ANSIBLE_CWL = "tripleo_dense,tripleo_profile_tasks,tripleo_states" ANSIBLE_CWL = "tripleo_dense,tripleo_profile_tasks,tripleo_states"
CONTAINER_IMAGE_PREPARE_LOG_FILE = "container_image_prepare.log" CONTAINER_IMAGE_PREPARE_LOG_FILE = "container_image_prepare.log"
DEFAULT_CONTAINER_REGISTRY = "quay.io" DEFAULT_CONTAINER_REGISTRY = "quay.io"
DEFAULT_CONTAINER_NAMESPACE = "tripleomaster" DEFAULT_CONTAINER_NAMESPACE = "tripleomastercentos9"
DEFAULT_CONTAINER_TAG = "current-tripleo" DEFAULT_CONTAINER_TAG = "current-tripleo"
DEFAULT_RESOURCE_REGISTRY = 'overcloud-resource-registry-puppet.yaml' DEFAULT_RESOURCE_REGISTRY = 'overcloud-resource-registry-puppet.yaml'
@ -49,7 +49,10 @@ if os.path.isfile(kolla_builder.DEFAULT_PREPARE_FILE):
DEFAULT_CONTAINER_IMAGE_PARAMS = kolla_builder.CONTAINER_IMAGES_DEFAULTS DEFAULT_CONTAINER_IMAGE_PARAMS = kolla_builder.CONTAINER_IMAGES_DEFAULTS
else: else:
DEFAULT_CONTAINER_IMAGE_PARAMS = { DEFAULT_CONTAINER_IMAGE_PARAMS = {
'namespace': 'quay.io/tripleomaster', 'namespace': '{}/{}'.format(
DEFAULT_CONTAINER_REGISTRY,
DEFAULT_CONTAINER_NAMESPACE
),
'name_prefix': 'openstack-', 'name_prefix': 'openstack-',
'tag': 'current-tripleo' 'tag': 'current-tripleo'
} }

View File

@ -134,9 +134,7 @@ class TestHeatPodLauncher(base.TestCase):
mock.ANY]), mock.ANY]),
mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat', mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat',
'--volume', mock.ANY, '--volume', mock.ANY, '--volume', mock.ANY, '--volume', mock.ANY,
'quay.io/tripleomaster/openstack-heat-api:current-' mock.ANY, 'heat-manage', 'db_sync'])
'tripleo',
'heat-manage', 'db_sync'])
] ]
self.assertEqual(self.check_call.mock_calls, calls) self.assertEqual(self.check_call.mock_calls, calls)
self.assertFalse(mock_do_restore_db.called) self.assertFalse(mock_do_restore_db.called)
@ -147,9 +145,8 @@ class TestHeatPodLauncher(base.TestCase):
launcher.heat_db_sync(restore_db=True) launcher.heat_db_sync(restore_db=True)
self.check_call.assert_called_once_with([ self.check_call.assert_called_once_with([
'sudo', 'podman', 'run', '--rm', '--user', 'heat', '--volume', 'sudo', 'podman', 'run', '--rm', '--user', 'heat', '--volume',
mock.ANY, '--volume', mock.ANY, mock.ANY, '--volume', mock.ANY, mock.ANY, 'heat-manage', 'db_sync'
'quay.io/tripleomaster/openstack-heat-api:current-tripleo', ])
'heat-manage', 'db_sync'])
self.assertTrue(mock_do_restore_db.called) self.assertTrue(mock_do_restore_db.called)
self.check_call.reset_mock() self.check_call.reset_mock()
@ -168,8 +165,7 @@ class TestHeatPodLauncher(base.TestCase):
'mysql', '-e', 'flush privileges;']), 'mysql', '-e', 'flush privileges;']),
mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat', mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat',
'--volume', mock.ANY, '--volume', mock.ANY, '--volume', mock.ANY, '--volume', mock.ANY,
'quay.io/tripleomaster/openstack-heat-api:current-' mock.ANY, 'heat-manage', 'db_sync'])
'tripleo', 'heat-manage', 'db_sync'])
] ]
self.assertEqual(self.check_call.mock_calls, calls) self.assertEqual(self.check_call.mock_calls, calls)
self.assertTrue(mock_do_restore_db.called) self.assertTrue(mock_do_restore_db.called)
@ -191,8 +187,7 @@ class TestHeatPodLauncher(base.TestCase):
'mysql', '-e', 'flush privileges;']), 'mysql', '-e', 'flush privileges;']),
mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat', mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat',
'--volume', mock.ANY, '--volume', mock.ANY, '--volume', mock.ANY, '--volume', mock.ANY,
'quay.io/tripleomaster/openstack-heat-api:current-' mock.ANY, 'heat-manage', 'db_sync'])
'tripleo', 'heat-manage', 'db_sync'])
] ]
self.assertEqual(self.check_call.mock_calls, calls) self.assertEqual(self.check_call.mock_calls, calls)
self.assertFalse(mock_do_restore_db.called) self.assertFalse(mock_do_restore_db.called)

View File

@ -148,7 +148,7 @@ class Build(command.Command):
"--namespace", "--namespace",
dest="namespace", dest="namespace",
metavar="<registry-namespace>", metavar="<registry-namespace>",
default="tripleomaster", default=constants.DEFAULT_CONTAINER_NAMESPACE,
help=_("Container registry namespace (default: %(default)s)"), help=_("Container registry namespace (default: %(default)s)"),
) )
parser.add_argument( parser.add_argument(