docker: fix volume plugin does not remount volume on docker restart
docker volume plugin restoreState: skip fs option if empty Fixes #6769 Co-authored-by: Peter Kreuser <logo@kreuser.name>
This commit is contained in:
parent
56b582cdb9
commit
5039f9be48
1 changed files with 7 additions and 5 deletions
|
@ -60,12 +60,14 @@ func (vol *Volume) applyOptions(volOpt VolOpts) error {
|
||||||
case "":
|
case "":
|
||||||
continue
|
continue
|
||||||
case "remote", "fs":
|
case "remote", "fs":
|
||||||
p, err := fspath.Parse(str)
|
if str != "" {
|
||||||
if err != nil || p.Name == ":" {
|
p, err := fspath.Parse(str)
|
||||||
return fmt.Errorf("cannot parse path %q: %w", str, err)
|
if err != nil || p.Name == ":" {
|
||||||
|
return fmt.Errorf("cannot parse path %q: %w", str, err)
|
||||||
|
}
|
||||||
|
fsName, fsPath, fsOpt = p.Name, p.Path, p.Config
|
||||||
|
vol.Fs = str
|
||||||
}
|
}
|
||||||
fsName, fsPath, fsOpt = p.Name, p.Path, p.Config
|
|
||||||
vol.Fs = str
|
|
||||||
case "type":
|
case "type":
|
||||||
fsType = str
|
fsType = str
|
||||||
vol.Type = str
|
vol.Type = str
|
||||||
|
|
Loading…
Reference in a new issue