Fix image parameter update

We need to use default image parameters as we create all
service chains irrespective of role count. We don't seem
to use the default resource registry that would have
service mappings OS::Heat::None that should be used for
filtering.

Closes-Bug: #1914396
Change-Id: Ie3fcb2ab509e73d4631e3ef4c9d6ecfad9894112
This commit is contained in:
ramishra 2021-02-03 18:22:40 +05:30
parent 632194ec03
commit ea363cbfa3
3 changed files with 21 additions and 6 deletions

View File

@ -38,6 +38,7 @@ CONTAINER_IMAGE_PREPARE_LOG_FILE = "container_image_prepare.log"
DEFAULT_CONTAINER_REGISTRY = "docker.io"
DEFAULT_CONTAINER_NAMESPACE = "tripleomaster"
DEFAULT_CONTAINER_TAG = "current-tripleo"
DEFAULT_RESOURCE_REGISTRY = 'overcloud-resource-registry-puppet.yaml'
DEFAULT_HEAT_CONTAINER = ('{}/{}/openstack-heat-all:{}'.format(
DEFAULT_CONTAINER_REGISTRY,
DEFAULT_CONTAINER_NAMESPACE,

View File

@ -167,6 +167,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
shutil.rmtree = self.real_shutil
self.mock_tar.stop()
@mock.patch('tripleo_common.utils.plan.default_image_params',
autospec=True)
@mock.patch('tripleoclient.utils.get_rc_params',
autospec=True)
@mock.patch('tripleo_common.utils.plan.generate_passwords',
@ -206,7 +208,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_get_ctlplane_attrs, mock_nic_ansiblei,
mock_process_env, mock_roles_data,
mock_container_prepare, mock_generate_password,
mock_rc_params):
mock_rc_params, mock_default_image_params):
fixture = deployment.DeploymentWorkflowFixture()
self.useFixture(fixture)
clients = self.app.client_manager
@ -280,6 +282,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_create_tempest_deployer_input.assert_called_with()
mock_copy.assert_called_once()
@mock.patch('tripleo_common.utils.plan.default_image_params',
autospec=True)
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True)
@mock.patch('tripleo_common.utils.plan.generate_passwords',
return_value={})
@ -320,7 +324,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_get_ctlplane_attrs,
mock_process_env, mock_roles_data,
mock_container_prepare, mock_generate_password,
mock_rc_params):
mock_rc_params, mock_default_image_params):
fixture = deployment.DeploymentWorkflowFixture()
self.useFixture(fixture)
plane_management_fixture = deployment.PlanManagementFixture()
@ -930,6 +934,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
self.cmd.take_action,
parsed_args)
@mock.patch('tripleo_common.utils.plan.default_image_params',
autospec=True)
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True)
@mock.patch('tripleo_common.utils.plan.generate_passwords',
return_value={})
@ -973,7 +979,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_roles_data,
mock_image_prepare,
mock_generate_password,
mock_rc_params):
mock_rc_params,
mock_default_image_params):
fixture = deployment.DeploymentWorkflowFixture()
self.useFixture(fixture)
plane_management_fixture = deployment.PlanManagementFixture()
@ -1243,6 +1250,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
self.assertTrue(fixture.mock_config_download.called)
mock_copy.assert_called_once()
@mock.patch('tripleo_common.utils.plan.default_image_params',
autospec=True)
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True)
@mock.patch('tripleo_common.utils.plan.generate_passwords',
return_value={})
@ -1274,7 +1283,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_get_ctlplane_attrs, mock_nic_ansible,
mock_process_env, mock_roles_data,
mock_container_prepare, mock_generate_password,
mock_rc_params):
mock_rc_params, mock_default_image_params):
fixture = deployment.DeploymentWorkflowFixture()
self.useFixture(fixture)
utils_fixture = deployment.UtilsOvercloudFixture()

View File

@ -101,6 +101,8 @@ class DeployOvercloud(command.Command):
# We need the processed env for the image parameters atm
env_files = []
env_files.append(
os.path.join(tht_root, constants.DEFAULT_RESOURCE_REGISTRY))
if args.environment_directories:
env_files.extend(utils.load_environment_directories(
args.environment_directories))
@ -110,11 +112,14 @@ class DeployOvercloud(command.Command):
_, env = utils.process_multiple_environments(
env_files, tht_root, user_tht_root,
cleanup=(not args.no_cleanup))
default_image_params = plan_utils.default_image_params()
image_params = kolla_builder.container_images_prepare_multi(
env, roles.get_roles_data(args.roles_file,
tht_root), dry_run=True)
if image_params:
parameters.update(image_params)
default_image_params.update(image_params)
parameters.update(default_image_params)
password_params = plan_utils.generate_passwords(
self.object_client, self.orchestration_client,
@ -320,7 +325,7 @@ class DeployOvercloud(command.Command):
created_env_files = []
created_env_files.append(
os.path.join(tht_root, 'overcloud-resource-registry-puppet.yaml'))
os.path.join(tht_root, constants.DEFAULT_RESOURCE_REGISTRY))
created_env_files.extend(
self._provision_baremetal(parsed_args, tht_root))