Switch to github.com/containerd/plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
@@ -25,10 +25,10 @@ import (
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/mount"
|
||||
"github.com/containerd/containerd/v2/oci"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"google.golang.org/grpc"
|
||||
@@ -66,14 +66,10 @@ func init() {
|
||||
orderedNames := ic.Config.(*config).Order
|
||||
ordered := make([]differ, len(orderedNames))
|
||||
for i, n := range orderedNames {
|
||||
differp, ok := differs[n]
|
||||
d, ok := differs[n]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("needed differ not loaded: %s", n)
|
||||
}
|
||||
d, err := differp.Instance()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not load required differ due plugin init error: %s: %w", n, err)
|
||||
}
|
||||
|
||||
ordered[i], ok = d.(differ)
|
||||
if !ok {
|
||||
|
||||
@@ -18,13 +18,12 @@ package diff
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
diffapi "github.com/containerd/containerd/v2/api/services/diff/v1"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -36,15 +35,7 @@ func init() {
|
||||
plugins.ServicePlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
sps, err := ic.GetByType(plugins.ServicePlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p, ok := sps[services.DiffService]
|
||||
if !ok {
|
||||
return nil, errors.New("diff service not found")
|
||||
}
|
||||
i, err := p.Instance()
|
||||
i, err := ic.GetByID(plugins.ServicePlugin, services.DiffService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user