Closed mhjacks closed 1 year ago
The .volume
file isn't needed. If no volume exists it should be auto-created. For example if you have this in your .container
file:
Volume=/var/foo
Then a local
volume will get autocreated for you. Try it out and run podman volume ls
to see.
Confirmed! This also works with arbitrary volume labels, which is really, really nice. Thanks
/kind feature
Description
Currently, quadlet requires the creation of volume files to auto-create volume services for containers to depend on. However, in degenerate cases, the entire volume file might be:
[Volume]
In a case where the UID/GID does not need to be set and there are no labels defined on the volume. Should
Steps to reproduce the issue:
Create a .conftainer file in /etc/containers/systemd that requires a volume
Declare the .volume file with simply
[Volume]
. Define a few more and mount them, if you're inclinedPonder whether there's a better way to specify volumes in such cases
Describe the results you received:
Declaration of volumes currently requires creating effectively empty files. This seems sub-optimal, though not a deal-breaker
Describe the results you expected:
What about declaring volumes in a separate section of the .container file? Or inferring them from the container file in some way?
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
orbrew info podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
I really like the quadlet model of instantiating and starting containers. It's expressive and relatively compact (except for the volume files, if needed). I believe there are cases where volumes need to be supported for workloads - and it's a bit of a challenge to do so. To be clear the existing .volume files are not a dealbreaker - but the existing docs don't have examples and it's not especially clear when or how to use them (the original quadlet repo had a bug about adding .volume file examples). So I'm asking - do we need them at all? If there are cases where we definitely do need them, I think it's better to make it explicit (and do it the way we are doing it) than to have two ways of doing it and introduce those complexities