feat: make overlay sync removal configurable
Signed-off-by: Cardy.Tang <zuniorone@gmail.com>
This commit is contained in:
parent
878132923d
commit
b9f2e48e37
@ -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...)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user