Skip to content

Commit

Permalink
Merge pull request #136 from nalind/option-aliases
Browse files Browse the repository at this point in the history
overlay, vfs: Accept options without the driver name prefix
  • Loading branch information
rhatdan authored Nov 10, 2017
2 parents 2ad21f0 + 2c38720 commit 33406af
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
@@ -227,20 +227,20 @@ func parseOptions(options []string) (*overlayOptions, error) {
}
key = strings.ToLower(key)
switch key {
case "overlay.override_kernel_check", "overlay2.override_kernel_check":
case ".override_kernel_check", "overlay.override_kernel_check", "overlay2.override_kernel_check":
logrus.Debugf("overlay: override_kernelcheck=%s", val)
o.overrideKernelCheck, err = strconv.ParseBool(val)
if err != nil {
return nil, err
}
case "overlay.size", "overlay2.size":
case ".size", "overlay.size", "overlay2.size":
logrus.Debugf("overlay: size=%s", val)
size, err := units.RAMInBytes(val)
if err != nil {
return nil, err
}
o.quota.Size = uint64(size)
case "overlay.imagestore", "overlay2.imagestore":
case ".imagestore", "overlay.imagestore", "overlay2.imagestore":
logrus.Debugf("overlay: imagestore=%s", val)
// Additional read only image stores to use for lower paths
for _, store := range strings.Split(val, ",") {
5 changes: 5 additions & 0 deletions drivers/vfs/driver.go
Original file line number Diff line number Diff line change
@@ -36,6 +36,11 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
for _, option := range options {
if strings.HasPrefix(option, "vfs.imagestore=") {
d.homes = append(d.homes, strings.Split(option[15:], ",")...)
continue
}
if strings.HasPrefix(option, ".imagestore=") {
d.homes = append(d.homes, strings.Split(option[12:], ",")...)
continue
}
}
return graphdriver.NewNaiveDiffDriver(d, uidMaps, gidMaps), nil

0 comments on commit 33406af

Please sign in to comment.