Support mode in named volumes when using podman

Volumes with a mode specifier were causing the container to fail to
start with the error: "Wrong format of volume". ironic-dnsmasq was one
services affected by this issue, but you could also hit this issue when
using the volume customisation variables.

Closes-Bug: #2054834
Change-Id: I848bd2838a17756f1c71b07befe1e3d966f5b6c2
This commit is contained in:
Will Szumski 2024-02-23 17:06:51 +00:00
parent ce3a6aff09
commit 9b3428c504
2 changed files with 12 additions and 2 deletions

View File

@ -176,7 +176,11 @@ class PodmanWorker(ContainerWorker):
mounts.append(mount_item)
else:
try:
src, dest = item.split(':')
mode = 'rw'
if item.count(':') == 2:
src, dest, mode = item.split(':')
else:
src, dest = item.split(':')
except ValueError:
self.module.fail_json(
msg="Wrong format of volume: {}".format(item),
@ -191,7 +195,7 @@ class PodmanWorker(ContainerWorker):
else:
filtered_volumes[src] = dict(
bind=dest,
mode='rw'
mode=mode
)
def parse_dimensions(self, dimensions):

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes an issue, when using podman, with named volumes that use a mode
specifier. See `LP#2054834
<https://bugs.launchpad.net/kolla-ansible/+bug/2054834>`_ for more details.