From 34f32043bc91dd5d39b37533a784f60521aa00db Mon Sep 17 00:00:00 2001 From: Danny Canter Date: Thu, 24 Aug 2023 13:25:58 -0700 Subject: [PATCH] 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 --- snapshots/blockfile/plugin/plugin.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snapshots/blockfile/plugin/plugin.go b/snapshots/blockfile/plugin/plugin.go index 8381537cf..03defdea4 100644 --- a/snapshots/blockfile/plugin/plugin.go +++ b/snapshots/blockfile/plugin/plugin.go @@ -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...) },