Add configurable mount options to overlay
Allows default mount options to be provided through configuration. Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
@@ -32,6 +32,9 @@ type Config struct {
|
||||
RootPath string `toml:"root_path"`
|
||||
UpperdirLabel bool `toml:"upperdir_label"`
|
||||
SyncRemove bool `toml:"sync_remove"`
|
||||
|
||||
// MountOptions are options used for the overlay mount (not used on bind mounts)
|
||||
MountOptions []string `toml:"mount_options"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -60,6 +63,10 @@ func init() {
|
||||
oOpts = append(oOpts, overlay.AsynchronousRemove)
|
||||
}
|
||||
|
||||
if len(config.MountOptions) > 0 {
|
||||
oOpts = append(oOpts, overlay.WithMountOptions(config.MountOptions))
|
||||
}
|
||||
|
||||
ic.Meta.Exports["root"] = root
|
||||
return overlay.NewSnapshotter(root, oOpts...)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user