From 759aab13f089978489a30264c23e0c3060fcebac Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 16 Jul 2018 11:24:15 +0200 Subject: [PATCH] storage: allow to override .fuse_program from the conf file Signed-off-by: Giuseppe Scrivano --- docs/containers-storage.conf.5.md | 7 +++---- storage.conf | 4 ++++ store.go | 7 +++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/containers-storage.conf.5.md b/docs/containers-storage.conf.5.md index 3b898e731d..6460fe9aec 100644 --- a/docs/containers-storage.conf.5.md +++ b/docs/containers-storage.conf.5.md @@ -55,6 +55,9 @@ 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. + [storage.options.thinpool] Storage Options for thinpool @@ -89,10 +92,6 @@ Tells driver to wipe device (directlvm_device) even if device already has a file Specifies the filesystem type to use for the base device. (default: xfs) -**fuse_program**="" - -Specifies the path to a custom FUSE program to use instead for mounting the file system. - **log_level**="" Sets the log level of devicemapper. diff --git a/storage.conf b/storage.conf index e1c0d2c449..740cc15424 100644 --- a/storage.conf +++ b/storage.conf @@ -25,6 +25,10 @@ additionalimagestores = [ # certain container storage drivers. size = "" +# Path to a FUSE helper to use for mounting the file system instead of mounting it +# directly. +#fuse_program = "/usr/bin/fuse-overlayfs" + # OverrideKernelCheck tells the driver to ignore kernel checks based on kernel version override_kernel_check = "false" diff --git a/store.go b/store.go index 4cdfe4e188..3b9bb734bd 100644 --- a/store.go +++ b/store.go @@ -2992,6 +2992,9 @@ type OptionsConfig struct { // Do not create a bind mount on the storage home SkipMountHome string `toml:"skip_mount_home"` + + // Alternative program to use for the mount of the file system + FuseProgram string `toml:"fuse_program"` } // TOML-friendly explicit tables used for conversions. @@ -3086,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.OverrideKernelCheck != "" { - storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.override_kernel_check=%s", config.Storage.Driver, config.Storage.Options.OverrideKernelCheck)) + 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.OverrideKernelCheck != "" { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.override_kernel_check=%s", config.Storage.Driver, config.Storage.Options.OverrideKernelCheck))