Move snapshot event publishing into metadata store

Removes the snapshot event publishing from the snapshot service.

Adds an option to metadata db to add a publisher. Adds event
publishing to prepare, commit, and remove snapshot operations.
Adds remove snapshot event to garbage collection.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2021-07-01 13:32:25 -07:00
parent 8f7cfbda29
commit 2c573de6d3
6 changed files with 115 additions and 85 deletions

View File

@@ -29,6 +29,7 @@ import (
"github.com/containerd/containerd/pkg/timeout"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/snapshots"
bolt "go.etcd.io/bbolt"
)
@@ -162,7 +163,7 @@ func init() {
}
dbopts := []metadata.DBOpt{
// metadata.WithEventsPublisher(ic.Events),
metadata.WithEventsPublisher(ic.Events),
}
if !shared {