Skip to content

Commit

Permalink
feat: make overlay sync removal configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Cardy.Tang <zuniorone@gmail.com>
(cherry picked from commit b9f2e48)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
  • Loading branch information
cardyok authored and fuweid committed Aug 12, 2023
1 parent 8559256 commit 453fa39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion snapshots/overlay/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,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() {
Expand All @@ -56,9 +57,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...)
},
})
}

0 comments on commit 453fa39

Please sign in to comment.