Set working cs9 defaults for image build

The current `openstack tripleo container image build` defaults result
in a failed build for the following reasons:
- The base image is ubi8 (rhel)
- The default --distro is centos
- tcib_release is a mandatory variable but is unset, resulting in a
  build failure

This change does the following:
- default --base is now centos:stream9
- new argument --release defaults to '9', which sets tcib_release

This results in built cs9 container images without requiring any
--base or --tcib-extras arguments.

Change-Id: I69346aa10d734580ba66e0dd571a27e46e123fe8
This commit is contained in:
Steve Baker 2022-08-22 10:46:26 +12:00
parent 2bd755822f
commit 54898e34f1
2 changed files with 17 additions and 5 deletions

View File

@ -269,8 +269,8 @@ class TestContainerImages(deploy_fakes.TestDeployOvercloud):
mock_find_image.return_value = rtn_value
cfgs = self.cmd.process_images(expected_images, parsed_args,
image_configs)
mock_find_image.assert_called_once_with(self.cmd, 'foo',
'/foo/tcib', 'ubi8')
mock_find_image.assert_called_once_with(
self.cmd, 'foo', '/foo/tcib', 'centos:stream9')
self.assertEqual(cfgs, {'foo': rtn_value})

View File

@ -69,7 +69,7 @@ class Build(command.Command):
"--base",
dest="base",
metavar="<base-image>",
default="ubi8",
default="centos:stream9",
help=_(
"Base image name, with optional version. Can be 'centos:8', "
"base name image will be 'centos' but 'centos:8' will be "
@ -105,8 +105,19 @@ class Build(command.Command):
default="centos",
metavar="<distro>",
help=_(
"Distro name, if undefined the system will build using the "
"host distro. (default: %(default)s)"
"Distro name which sets tcib_distro, if undefined the "
"system will build using the host distro. "
"(default: %(default)s)"
),
)
parser.add_argument(
"--release",
dest="release",
default="9",
metavar="<release>",
help=_(
"Distro major release version which sets tcib_release. "
"(default: %(default)s)"
),
)
parser.add_argument(
@ -577,6 +588,7 @@ class Build(command.Command):
{
"workdir": self.image_paths.get(image, work_dir),
"tcib_distro": parsed_args.distro,
"tcib_release": parsed_args.release,
"tcib_path": self.image_paths.get(image, work_dir),
"tcib_meta": {"name": image_parsed_name},
"ansible_connection": "local",