Merge pull request #8542 from cardyok/feat_overlay_sync_remove

feat: make overlay sync removal configurable
This commit is contained in:
Derek McGowan 2023-05-22 17:29:45 -07:00 committed by GitHub
commit 44df496d75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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...)
},
})
}