Skip to content

Commit

Permalink
storage: rename fuse_program to mount_program
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jul 16, 2018
1 parent 759aab1 commit e933db5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/containers-storage.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ The `storage.options` table supports the following options:
old, the driver is not supported. But for kernels that have had the drivers backported, this flag
allows users to override the checks

**fuse_program**=""
Specifies the path to a custom FUSE program to use instead for mounting the file system.
**mount_program**=""
Specifies the path to a custom program to use instead for mounting the file system.

[storage.options.thinpool]

Expand Down
22 changes: 11 additions & 11 deletions drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type overlayOptions struct {
overrideKernelCheck bool
imageStores []string
quota quota.Quota
fuseProgram string
mountProgram string
ostreeRepo string
skipMountHome bool
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
}

var supportsDType bool
if opts.fuseProgram != "" {
if opts.mountProgram != "" {
supportsDType = true
} else {
supportsDType, err = supportsOverlay(home, fsMagic, rootUID, rootGID)
Expand Down Expand Up @@ -246,13 +246,13 @@ func parseOptions(options []string) (*overlayOptions, error) {
}
o.imageStores = append(o.imageStores, store)
}
case ".fuse_program", "overlay.fuse_program", "overlay2.fuse_program":
logrus.Debugf("overlay: fuse_program=%s", val)
case ".mount_program", "overlay.mount_program", "overlay2.mount_program":
logrus.Debugf("overlay: mount_program=%s", val)
_, err := os.Stat(val)
if err != nil {
return nil, fmt.Errorf("overlay: can't stat FUSE program %s: %v", val, err)
return nil, fmt.Errorf("overlay: can't stat program %s: %v", val, err)
}
o.fuseProgram = val
o.mountProgram = val
case "overlay2.ostree_repo", "overlay.ostree_repo", ".ostree_repo":
logrus.Debugf("overlay: ostree_repo=%s", val)
if !ostree.OstreeSupport() {
Expand Down Expand Up @@ -713,19 +713,19 @@ func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
// the page size. The mount syscall fails if the mount data cannot
// fit within a page and relative links make the mount data much
// smaller at the expense of requiring a fork exec to chroot.
if len(mountData) > pageSize || d.options.fuseProgram != "" {
if len(mountData) > pageSize || d.options.mountProgram != "" {
//FIXME: We need to figure out to get this to work with additional stores
opts = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", strings.Join(relLowers, ":"), path.Join(id, "diff"), path.Join(id, "work"))
mountData = label.FormatMountLabel(opts, mountLabel)
if len(mountData) > pageSize {
return "", fmt.Errorf("cannot mount layer, mount label too large %d", len(mountData))
}

if d.options.fuseProgram != "" {
if d.options.mountProgram != "" {
mount = func(source string, target string, mType string, flags uintptr, label string) error {
cmdRootless := exec.Command(d.options.fuseProgram, "-o", label, target)
cmdRootless.Dir = d.home
return cmdRootless.Run()
mountProgram := exec.Command(d.options.mountProgram, "-o", label, target)
mountProgram.Dir = d.home
return mountProgram.Run()
}
} else {
mount = func(source string, target string, mType string, flags uintptr, label string) error {
Expand Down
4 changes: 2 additions & 2 deletions storage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ additionalimagestores = [
# certain container storage drivers.
size = ""

# Path to a FUSE helper to use for mounting the file system instead of mounting it
# Path to an helper program to use for mounting the file system instead of mounting it
# directly.
#fuse_program = "/usr/bin/fuse-overlayfs"
#mount_program = "/usr/bin/fuse-overlayfs"

# OverrideKernelCheck tells the driver to ignore kernel checks based on kernel version
override_kernel_check = "false"
Expand Down
6 changes: 3 additions & 3 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2994,7 +2994,7 @@ type OptionsConfig struct {
SkipMountHome string `toml:"skip_mount_home"`

// Alternative program to use for the mount of the file system
FuseProgram string `toml:"fuse_program"`
MountProgram string `toml:"mount_program"`
}

// TOML-friendly explicit tables used for conversions.
Expand Down Expand Up @@ -3089,8 +3089,8 @@ func ReloadConfigurationFile(configFile string, storeOptions *StoreOptions) {
if config.Storage.Options.SkipMountHome != "" {
storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.skip_mount_home=%s", config.Storage.Driver, config.Storage.Options.SkipMountHome))
}
if config.Storage.Options.FuseProgram != "" {
storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.fuse_program=%s", config.Storage.Driver, config.Storage.Options.FuseProgram))
if config.Storage.Options.MountProgram != "" {
storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.mount_program=%s", config.Storage.Driver, config.Storage.Options.MountProgram))
}
if config.Storage.Options.OverrideKernelCheck != "" {
storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.override_kernel_check=%s", config.Storage.Driver, config.Storage.Options.OverrideKernelCheck))
Expand Down

0 comments on commit e933db5

Please sign in to comment.