-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Feature request description
When using Quadlet, it's possible to abstract away a bind mount with a volume, like this:
data.volume:
[Volume]
Type=bind
Device=/var/lib/special-data
program.container:
[Container]
Image=docker.io/alpine:latest
Exec=tail -f /dev/null
Mount=data.volume:/data:z
This would allow shipping quadlet definitions in a system image, then on provisioning add drop-ins to override where the host mount point is (or to use regular managed volumes).
However, the generated volume units do not contain RequiresMountsFor (would be RequiresMountsFor=/var/lib/special-data in this case), which meant depending .container files will not wait for the referenced bind mount location to be available before starting.
Suggest potential solution
For Type=bind .volume, add the value of Device to RequiresMountsFor if it's an absolute path.
Have you considered any alternatives?
This can be manually done by adding RequiresMountsFor to the [Unit] section of .volume files, but it is prone to being out-of-sync with the actual Device definition.
Additional context
No response