From b9f2e48e370ec915a1bfc2e7e2cb1e435b142a35 Mon Sep 17 00:00:00 2001 From: "Cardy.Tang" Date: Fri, 19 May 2023 16:32:10 +0800 Subject: [PATCH] feat: make overlay sync removal configurable Signed-off-by: Cardy.Tang --- snapshots/overlay/plugin/plugin.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snapshots/overlay/plugin/plugin.go b/snapshots/overlay/plugin/plugin.go index 12059fcd8..0d3633a2e 100644 --- a/snapshots/overlay/plugin/plugin.go +++ b/snapshots/overlay/plugin/plugin.go @@ -31,6 +31,7 @@ type Config struct { // Root directory for the plugin RootPath string `toml:"root_path"` UpperdirLabel bool `toml:"upperdir_label"` + SyncRemove bool `toml:"sync_remove"` } func init() { @@ -55,9 +56,12 @@ func init() { if config.UpperdirLabel { oOpts = append(oOpts, overlay.WithUpperdirLabel) } + if !config.SyncRemove { + oOpts = append(oOpts, overlay.AsynchronousRemove) + } ic.Meta.Exports["root"] = root - return overlay.NewSnapshotter(root, append(oOpts, overlay.AsynchronousRemove)...) + return overlay.NewSnapshotter(root, oOpts...) }, }) }