Blockfile: Expose RecreateScratch option

This was the only option not configurable from the toml for the plugin.
This is useful if you want to restart containerd and try a different
blockfile/size for the snapshotter.

Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
Danny Canter 2023-08-24 13:25:58 -07:00
parent db5fc4ab45
commit 34f32043bc

View File

@ -37,6 +37,10 @@ type Config struct {
// MountOptions are options used for the mount
MountOptions []string `toml:"mount_options"`
// RecreateScratch always recreates the specified `ScratchFile`
// on initialization of the plugin instead of using an existing.
RecreateScratch bool `toml:"recreate_scratch"`
}
func init() {
@ -66,6 +70,7 @@ func init() {
if len(config.MountOptions) > 0 {
opts = append(opts, blockfile.WithMountOptions(config.MountOptions))
}
opts = append(opts, blockfile.WithRecreateScratch(config.RecreateScratch))
return blockfile.NewSnapshotter(root, opts...)
},