From 4ac60f8890c61e95a426fdf31f5ddcb176ea842f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 27 Jun 2021 00:49:05 +0900 Subject: [PATCH] Validate the container_cli option The container_cli option should be set to podman because docker is no longer supported since Ussuri. This change ensures its value is validated at parser layer. Change-Id: I9e1177e68d1d6fbbe0a2ca0350ece1c6c656ccaf --- releasenotes/notes/container_cli-803238248de9c60a.yaml | 5 +++++ tripleoclient/config/standalone.py | 8 ++++---- tripleoclient/v1/undercloud_config.py | 9 +++------ 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/container_cli-803238248de9c60a.yaml diff --git a/releasenotes/notes/container_cli-803238248de9c60a.yaml b/releasenotes/notes/container_cli-803238248de9c60a.yaml new file mode 100644 index 000000000..73d936f46 --- /dev/null +++ b/releasenotes/notes/container_cli-803238248de9c60a.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + The ``container_cli`` parameter no longer accepts ``docker``. Now only + ``podman`` is accepted as a valid value. diff --git a/tripleoclient/config/standalone.py b/tripleoclient/config/standalone.py index c99d942c9..29da551e0 100644 --- a/tripleoclient/config/standalone.py +++ b/tripleoclient/config/standalone.py @@ -122,8 +122,7 @@ class StandaloneConfig(BaseConfig): cfg.StrOpt('deployment_user', help=_( 'User used to run openstack undercloud install ' - 'command which will be used to add the user to the ' - 'docker group, required to upload containers'), + 'command.') ), cfg.StrOpt('hieradata_override', default='', @@ -210,7 +209,7 @@ class StandaloneConfig(BaseConfig): 'configuration and can be used to override ' 'any derived values. This should be used ' 'only by advanced users.')), - # docker config bits + # container config bits cfg.StrOpt('container_registry_mirror', deprecated_name='docker_registry_mirror', default='', @@ -226,8 +225,9 @@ class StandaloneConfig(BaseConfig): ), cfg.StrOpt('container_cli', default='podman', + choices=('podman',), help=_('Container CLI used for deployment; ' - 'Can be docker or podman.')), + 'Only podman is allowed.')), cfg.BoolOpt('container_healthcheck_disabled', default=False, help=_( diff --git a/tripleoclient/v1/undercloud_config.py b/tripleoclient/v1/undercloud_config.py index 464c1d92e..47a6066f4 100644 --- a/tripleoclient/v1/undercloud_config.py +++ b/tripleoclient/v1/undercloud_config.py @@ -527,12 +527,9 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True, env_data['DockerInsecureRegistryAddress'].append( CONF['undercloud_admin_host']) else: - env_data['DockerInsecureRegistryAddress'] = [ - '%s:8787' % local_registry_name] - env_data['DockerInsecureRegistryAddress'].append( - '%s:8787' % CONF['local_ip'].split('/')[0]) - env_data['DockerInsecureRegistryAddress'].append( - '%s:8787' % CONF['undercloud_admin_host']) + msg = ('Unsupported container_cli: %s' % CONF['container_cli']) + raise exceptions.InvalidConfiguration(msg) + env_data['DockerInsecureRegistryAddress'].extend( CONF['container_insecure_registries'])