mirror of
https://github.com/containers/podman.git
synced 2025-10-17 03:04:21 +08:00
quadlet: generate RequiresMountsFor for Type=bind volumes
This makes sure that the volume source is available before the volume is created. Fixes: https://github.com/containers/podman/issues/26125 Signed-off-by: Hiếu Lê <leorize+oss@disroot.org>
This commit is contained in:
@ -1115,6 +1115,9 @@ func ConvertVolume(volume *parser.UnitFile, name string, unitsInfoMap map[string
|
||||
if ok && len(devType) != 0 {
|
||||
if devValid {
|
||||
podman.add("--opt", fmt.Sprintf("type=%s", devType))
|
||||
if devType == "bind" {
|
||||
service.Add(UnitGroup, "RequiresMountsFor", dev)
|
||||
}
|
||||
} else {
|
||||
return nil, warnings, fmt.Errorf("key Type can't be used without Device")
|
||||
}
|
||||
|
Reference in New Issue
Block a user