Add subpath support to volumes with type volume in `--mount` option
To allow subpath mount as describes in Compose Specs, in complement of #1336
Compose entries exemple:
- type: volume source: webservices target: /srv/www/vhosts/server1 read_only: true volume: subpath: server1
- type: volume source: webservices target: /srv/www/vhosts/server2 read_only: true volume: subpath: server2
- type: volume source: webservices target: /srv/www/vhosts/server2/uploads read_only: false volume: subpath: server2/uploads
Runs podman with options
--mount type=volume,source=webservices,target=/srv/www/vhosts/server1,ro
--mount type=volume,source=webservices,target=/srv/www/vhosts/server2,ro,subpath=server2
--mount type=volume,source=webservices,target=/srv/www/vhosts/server2/uploads,subpath=server2/uploads
Contributor Checklist:
If this PR adds a new feature that improves compatibility with docker-compose, please add a link to the exact part of compose spec that the PR touches.
For any user-visible change please add a release note to newsfragments directory, e.g. newsfragments/my_feature.feature. See newsfragments/README.md for more details.
All changes require additional unit tests.
The test added is finally removed because get_mount_args calls assert_volume which fails running podman inspect volume xxxx. In the testcase contexte, this returns unexpected NoneType then break calling .decode("utf-8") podman_compose.py:430
Tests can still be added for mount_desc_to_mount_args. As for get_mount_args, would it be possible to patch assert_volume to do nothing for test?
@p12tic, I just add the unittests and modify podman_compose.py to get it working.
Hum, my commits messages have typo ... I change them ...
Hi there. Apart from time, is there anything else missing for merging ?
Have a nice Christmas week everyone :)