Merge pull request #909 from vburenin/diff-plugin
Make Diff/Apply plugable
This commit is contained in:
12
plugin/differ.go
Normal file
12
plugin/differ.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/mount"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type Differ interface {
|
||||
Apply(ctx context.Context, desc ocispec.Descriptor, mount []mount.Mount) (ocispec.Descriptor, error)
|
||||
DiffMounts(ctx context.Context, lower, upper []mount.Mount, media, ref string) (ocispec.Descriptor, error)
|
||||
}
|
||||
@@ -19,6 +19,7 @@ const (
|
||||
GRPCPlugin
|
||||
SnapshotPlugin
|
||||
TaskMonitorPlugin
|
||||
DiffPlugin
|
||||
)
|
||||
|
||||
type Registration struct {
|
||||
@@ -35,6 +36,7 @@ type InitContext struct {
|
||||
Content content.Store
|
||||
Meta *bolt.DB
|
||||
Snapshotter snapshot.Snapshotter
|
||||
Differ Differ
|
||||
Config interface{}
|
||||
Context context.Context
|
||||
Monitor TaskMonitor
|
||||
|
||||
Reference in New Issue
Block a user