Merge "Use host network for db_sync"
This commit is contained in:
commit
85c50ca3de
@ -375,6 +375,7 @@ class HeatContainerLauncher(HeatBaseLauncher):
|
||||
|
||||
cmd = [
|
||||
'podman', 'run', '--rm',
|
||||
'--net', 'host',
|
||||
'--user', self.user,
|
||||
'--volume', '%(conf)s:/etc/heat/heat.conf:Z' % {'conf':
|
||||
self.config_file},
|
||||
@ -388,6 +389,7 @@ class HeatContainerLauncher(HeatBaseLauncher):
|
||||
def get_heat_uid(self):
|
||||
cmd = [
|
||||
'podman', 'run', '--rm',
|
||||
'--net', 'host',
|
||||
self.all_container_image,
|
||||
'getent', 'passwd', self.user
|
||||
]
|
||||
@ -402,6 +404,7 @@ class HeatContainerLauncher(HeatBaseLauncher):
|
||||
def get_heat_gid(self):
|
||||
cmd = [
|
||||
'podman', 'run', '--rm',
|
||||
'--net', 'host',
|
||||
self.all_container_image,
|
||||
'getent', 'group', self.user
|
||||
]
|
||||
@ -546,6 +549,7 @@ class HeatPodLauncher(HeatContainerLauncher):
|
||||
cmd = [
|
||||
'sudo', 'podman', 'run', '--rm',
|
||||
'--user', 'heat',
|
||||
'--net', 'host',
|
||||
'--volume', '%(conf)s:/etc/heat/heat.conf:z' % {'conf':
|
||||
self.config_file},
|
||||
'--volume', '%(inst_tmp)s:%(inst_tmp)s:z' % {'inst_tmp':
|
||||
|
@ -136,8 +136,8 @@ class TestHeatPodLauncher(base.TestCase):
|
||||
mock.call(['chcon', '-R', '-t', 'container_file_t', '-l', 's0',
|
||||
mock.ANY]),
|
||||
mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat',
|
||||
'--volume', mock.ANY, '--volume', mock.ANY,
|
||||
mock.ANY, 'heat-manage', 'db_sync'])
|
||||
'--net', 'host', '--volume', mock.ANY, '--volume',
|
||||
mock.ANY, mock.ANY, 'heat-manage', 'db_sync'])
|
||||
]
|
||||
self.assertEqual(self.check_call.mock_calls, calls)
|
||||
self.assertFalse(mock_do_restore_db.called)
|
||||
@ -147,8 +147,9 @@ class TestHeatPodLauncher(base.TestCase):
|
||||
mock_db_exists.return_value = True
|
||||
launcher.heat_db_sync(restore_db=True)
|
||||
self.check_call.assert_called_once_with([
|
||||
'sudo', 'podman', 'run', '--rm', '--user', 'heat', '--volume',
|
||||
mock.ANY, '--volume', mock.ANY, mock.ANY, 'heat-manage', 'db_sync'
|
||||
'sudo', 'podman', 'run', '--rm', '--user', 'heat', '--net', 'host',
|
||||
'--volume', mock.ANY, '--volume', mock.ANY, mock.ANY,
|
||||
'heat-manage', 'db_sync'
|
||||
])
|
||||
self.assertTrue(mock_do_restore_db.called)
|
||||
|
||||
@ -167,8 +168,8 @@ class TestHeatPodLauncher(base.TestCase):
|
||||
mock.call(['sudo', 'podman', 'exec', '-u', 'root', 'mysql',
|
||||
'mysql', '-e', 'flush privileges;']),
|
||||
mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat',
|
||||
'--volume', mock.ANY, '--volume', mock.ANY,
|
||||
mock.ANY, 'heat-manage', 'db_sync'])
|
||||
'--net', 'host', '--volume', mock.ANY, '--volume',
|
||||
mock.ANY, mock.ANY, 'heat-manage', 'db_sync'])
|
||||
]
|
||||
self.assertEqual(self.check_call.mock_calls, calls)
|
||||
self.assertTrue(mock_do_restore_db.called)
|
||||
@ -189,8 +190,8 @@ class TestHeatPodLauncher(base.TestCase):
|
||||
mock.call(['sudo', 'podman', 'exec', '-u', 'root', 'mysql',
|
||||
'mysql', '-e', 'flush privileges;']),
|
||||
mock.call(['sudo', 'podman', 'run', '--rm', '--user', 'heat',
|
||||
'--volume', mock.ANY, '--volume', mock.ANY,
|
||||
mock.ANY, 'heat-manage', 'db_sync'])
|
||||
'--net', 'host', '--volume', mock.ANY, '--volume',
|
||||
mock.ANY, mock.ANY, 'heat-manage', 'db_sync'])
|
||||
]
|
||||
self.assertEqual(self.check_call.mock_calls, calls)
|
||||
self.assertFalse(mock_do_restore_db.called)
|
||||
|
Loading…
Reference in New Issue
Block a user