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:
Derek McGowan
2023-06-10 22:49:51 -07:00
parent 98b7dfb870
commit d115129d1e
3 changed files with 53 additions and 21 deletions

View File

@@ -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...)
},