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
This commit is contained in:
Takashi Kajinami 2021-06-27 00:49:05 +09:00
parent b5ca0f42bd
commit 4ac60f8890
3 changed files with 12 additions and 10 deletions

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The ``container_cli`` parameter no longer accepts ``docker``. Now only
``podman`` is accepted as a valid value.

View File

@ -122,8 +122,7 @@ class StandaloneConfig(BaseConfig):
cfg.StrOpt('deployment_user', cfg.StrOpt('deployment_user',
help=_( help=_(
'User used to run openstack undercloud install ' 'User used to run openstack undercloud install '
'command which will be used to add the user to the ' 'command.')
'docker group, required to upload containers'),
), ),
cfg.StrOpt('hieradata_override', cfg.StrOpt('hieradata_override',
default='', default='',
@ -210,7 +209,7 @@ class StandaloneConfig(BaseConfig):
'configuration and can be used to override ' 'configuration and can be used to override '
'any derived values. This should be used ' 'any derived values. This should be used '
'only by advanced users.')), 'only by advanced users.')),
# docker config bits # container config bits
cfg.StrOpt('container_registry_mirror', cfg.StrOpt('container_registry_mirror',
deprecated_name='docker_registry_mirror', deprecated_name='docker_registry_mirror',
default='', default='',
@ -226,8 +225,9 @@ class StandaloneConfig(BaseConfig):
), ),
cfg.StrOpt('container_cli', cfg.StrOpt('container_cli',
default='podman', default='podman',
choices=('podman',),
help=_('Container CLI used for deployment; ' help=_('Container CLI used for deployment; '
'Can be docker or podman.')), 'Only podman is allowed.')),
cfg.BoolOpt('container_healthcheck_disabled', cfg.BoolOpt('container_healthcheck_disabled',
default=False, default=False,
help=_( help=_(

View File

@ -527,12 +527,9 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True,
env_data['DockerInsecureRegistryAddress'].append( env_data['DockerInsecureRegistryAddress'].append(
CONF['undercloud_admin_host']) CONF['undercloud_admin_host'])
else: else:
env_data['DockerInsecureRegistryAddress'] = [ msg = ('Unsupported container_cli: %s' % CONF['container_cli'])
'%s:8787' % local_registry_name] raise exceptions.InvalidConfiguration(msg)
env_data['DockerInsecureRegistryAddress'].append(
'%s:8787' % CONF['local_ip'].split('/')[0])
env_data['DockerInsecureRegistryAddress'].append(
'%s:8787' % CONF['undercloud_admin_host'])
env_data['DockerInsecureRegistryAddress'].extend( env_data['DockerInsecureRegistryAddress'].extend(
CONF['container_insecure_registries']) CONF['container_insecure_registries'])