Add mount options to blockfile snapshotter

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-05-23 10:33:23 -07:00
parent 773874caea
commit 7beaa5e859
3 changed files with 27 additions and 4 deletions

View File

@@ -34,6 +34,9 @@ type Config struct {
// FSType is the filesystem type for the mount
FSType string `toml:"fs_type"`
// MountOptions are options used for the mount
MountOptions []string `toml:"mount_options"`
}
func init() {
@@ -60,6 +63,9 @@ func init() {
if config.FSType != "" {
opts = append(opts, blockfile.WithFSType(config.FSType))
}
if len(config.MountOptions) > 0 {
opts = append(opts, blockfile.WithMountOptions(config.MountOptions))
}
return blockfile.NewSnapshotter(root, opts...)
},