diff --git a/releasenotes/notes/heat_launcher_podman-80870701fe4d99a5.yaml b/releasenotes/notes/heat_launcher_podman-80870701fe4d99a5.yaml new file mode 100644 index 000000000..131ffe08d --- /dev/null +++ b/releasenotes/notes/heat_launcher_podman-80870701fe4d99a5.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Switch the Heat Launcher to use Podman instead of Docker when + heat_native is disabled. diff --git a/tripleoclient/heat_launcher.py b/tripleoclient/heat_launcher.py index a16f37412..97c2203e0 100644 --- a/tripleoclient/heat_launcher.py +++ b/tripleoclient/heat_launcher.py @@ -230,15 +230,15 @@ limit_iterators=9000 temp_file.write(ks_token) -class HeatDockerLauncher(HeatBaseLauncher): +class HeatContainerLauncher(HeatBaseLauncher): def __init__(self, api_port, container_image, user='heat'): - super(HeatDockerLauncher, self).__init__(api_port, container_image, - user) + super(HeatContainerLauncher, self).__init__(api_port, container_image, + user) def launch_heat(self): cmd = [ - 'docker', 'run', + 'podman', 'run', '--name', 'heat_all', '--user', self.user, '--net', 'host', @@ -263,7 +263,7 @@ class HeatDockerLauncher(HeatBaseLauncher): def heat_db_sync(self): cmd = [ - 'docker', 'run', '--rm', + 'podman', 'run', '--rm', '--user', self.user, '--volume', '%(conf)s:/etc/heat/heat.conf:Z' % {'conf': self.config_file}, @@ -276,7 +276,7 @@ class HeatDockerLauncher(HeatBaseLauncher): def get_heat_uid(self): cmd = [ - 'docker', 'run', '--rm', + 'podman', 'run', '--rm', self.container_image, 'getent', 'passwd', self.user ] @@ -290,7 +290,7 @@ class HeatDockerLauncher(HeatBaseLauncher): def get_heat_gid(self): cmd = [ - 'docker', 'run', '--rm', + 'podman', 'run', '--rm', self.container_image, 'getent', 'group', self.user ] @@ -303,7 +303,7 @@ class HeatDockerLauncher(HeatBaseLauncher): raise Exception('Could not find heat gid') def kill_heat(self, pid): - cmd = ['docker', 'rm', '-f', 'heat_all'] + cmd = ['podman', 'rm', '-f', 'heat_all'] log.debug(' '.join(cmd)) # We don't want to hear from this command.. subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) diff --git a/tripleoclient/v1/tripleo_deploy.py b/tripleoclient/v1/tripleo_deploy.py index 22afe7f79..af1957d95 100644 --- a/tripleoclient/v1/tripleo_deploy.py +++ b/tripleoclient/v1/tripleo_deploy.py @@ -470,7 +470,7 @@ class Deploy(command.Command): # we do this as root to chown config files properly for docker, etc. if parsed_args.heat_native is not None and \ parsed_args.heat_native.lower() == "false": - self.heat_launch = heat_launcher.HeatDockerLauncher( + self.heat_launch = heat_launcher.HeatContainerLauncher( parsed_args.heat_api_port, parsed_args.heat_container_image, parsed_args.heat_user)