Skip to content
Snippets Groups Projects
Commit 9b3428c5 authored by Will Szumski's avatar Will Szumski
Browse files

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
parent ce3a6aff
No related branches found
No related tags found
No related merge requests found
...@@ -176,7 +176,11 @@ class PodmanWorker(ContainerWorker): ...@@ -176,7 +176,11 @@ class PodmanWorker(ContainerWorker):
mounts.append(mount_item) mounts.append(mount_item)
else: else:
try: try:
src, dest = item.split(':') mode = 'rw'
if item.count(':') == 2:
src, dest, mode = item.split(':')
else:
src, dest = item.split(':')
except ValueError: except ValueError:
self.module.fail_json( self.module.fail_json(
msg="Wrong format of volume: {}".format(item), msg="Wrong format of volume: {}".format(item),
...@@ -191,7 +195,7 @@ class PodmanWorker(ContainerWorker): ...@@ -191,7 +195,7 @@ class PodmanWorker(ContainerWorker):
else: else:
filtered_volumes[src] = dict( filtered_volumes[src] = dict(
bind=dest, bind=dest,
mode='rw' mode=mode
) )
def parse_dimensions(self, dimensions): def parse_dimensions(self, dimensions):
......
---
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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment