Switch to github.com/containerd/plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
@@ -26,11 +26,11 @@ import (
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/events"
|
||||
"github.com/containerd/containerd/v2/metadata"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
bolt "go.etcd.io/bbolt"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
@@ -47,11 +47,11 @@ func init() {
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
m, err := ic.Get(plugins.MetadataPlugin)
|
||||
m, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ep, err := ic.Get(plugins.EventPlugin)
|
||||
ep, err := ic.GetSingle(plugins.EventPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -18,15 +18,14 @@ package containers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
api "github.com/containerd/containerd/v2/api/services/containers/v1"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -38,15 +37,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.ContainersService]
|
||||
if !ok {
|
||||
return nil, errors.New("containers service not found")
|
||||
}
|
||||
i, err := p.Instance()
|
||||
i, err := ic.GetByID(plugins.ServicePlugin, services.ContainersService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -17,14 +17,12 @@
|
||||
package content
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/containerd/containerd/v2/content"
|
||||
"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/containerd/v2/services/content/contentserver"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -35,15 +33,7 @@ func init() {
|
||||
plugins.ServicePlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
plugins, err := ic.GetByType(plugins.ServicePlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p, ok := plugins[services.ContentService]
|
||||
if !ok {
|
||||
return nil, errors.New("content store service not found")
|
||||
}
|
||||
cs, err := p.Instance()
|
||||
cs, err := ic.GetByID(plugins.ServicePlugin, services.ContentService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -23,10 +23,10 @@ import (
|
||||
"github.com/containerd/containerd/v2/content"
|
||||
"github.com/containerd/containerd/v2/events"
|
||||
"github.com/containerd/containerd/v2/metadata"
|
||||
"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"
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
)
|
||||
|
||||
@@ -45,11 +45,11 @@ func init() {
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
m, err := ic.Get(plugins.MetadataPlugin)
|
||||
m, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ep, err := ic.Get(plugins.EventPlugin)
|
||||
ep, err := ic.GetSingle(plugins.EventPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ import (
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/events"
|
||||
"github.com/containerd/containerd/v2/events/exchange"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/protobuf"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"github.com/containerd/ttrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package healthcheck
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/health"
|
||||
|
||||
@@ -33,12 +33,12 @@ import (
|
||||
"github.com/containerd/containerd/v2/metadata"
|
||||
"github.com/containerd/containerd/v2/pkg/deprecation"
|
||||
"github.com/containerd/containerd/v2/pkg/epoch"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/containerd/v2/services/warning"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -52,19 +52,19 @@ func init() {
|
||||
plugins.WarningPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
m, err := ic.Get(plugins.MetadataPlugin)
|
||||
m, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
g, err := ic.Get(plugins.GCPlugin)
|
||||
g, err := ic.GetSingle(plugins.GCPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ep, err := ic.Get(plugins.EventPlugin)
|
||||
ep, err := ic.GetSingle(plugins.EventPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
w, err := ic.Get(plugins.WarningPlugin)
|
||||
w, err := ic.GetSingle(plugins.WarningPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -18,14 +18,13 @@ package images
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
imagesapi "github.com/containerd/containerd/v2/api/services/images/v1"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -37,15 +36,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.ImagesService]
|
||||
if !ok {
|
||||
return nil, errors.New("images service not found")
|
||||
}
|
||||
i, err := p.Instance()
|
||||
i, err := ic.GetByID(plugins.ServicePlugin, services.ImagesService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -34,13 +34,13 @@ import (
|
||||
"github.com/containerd/containerd/v2/api/types"
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/filters"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/protobuf"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/containerd/v2/services/warning"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -49,16 +49,7 @@ func init() {
|
||||
ID: services.IntrospectionService,
|
||||
Requires: []plugin.Type{plugins.WarningPlugin},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
sps, err := ic.GetByType(plugins.WarningPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p, ok := sps[plugins.DeprecationsPlugin]
|
||||
if !ok {
|
||||
return nil, errors.New("warning service not found")
|
||||
}
|
||||
|
||||
i, err := p.Instance()
|
||||
i, err := ic.GetByID(plugins.WarningPlugin, plugins.DeprecationsPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ import (
|
||||
"errors"
|
||||
|
||||
api "github.com/containerd/containerd/v2/api/services/introspection/v1"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -35,16 +35,7 @@ func init() {
|
||||
ID: "introspection",
|
||||
Requires: []plugin.Type{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.IntrospectionService]
|
||||
if !ok {
|
||||
return nil, errors.New("introspection service not found")
|
||||
}
|
||||
|
||||
i, err := p.Instance()
|
||||
i, err := ic.GetByID(plugins.ServicePlugin, services.IntrospectionService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ import (
|
||||
api "github.com/containerd/containerd/v2/api/services/leases/v1"
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/leases"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/protobuf"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ import (
|
||||
"github.com/containerd/containerd/v2/events"
|
||||
"github.com/containerd/containerd/v2/metadata"
|
||||
"github.com/containerd/containerd/v2/namespaces"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
bolt "go.etcd.io/bbolt"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
@@ -46,11 +46,11 @@ func init() {
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
m, err := ic.Get(plugins.MetadataPlugin)
|
||||
m, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ep, err := ic.Get(plugins.EventPlugin)
|
||||
ep, err := ic.GetSingle(plugins.EventPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -18,14 +18,13 @@ package namespaces
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
api "github.com/containerd/containerd/v2/api/services/namespaces/v1"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -37,15 +36,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.NamespacesService]
|
||||
if !ok {
|
||||
return nil, errors.New("namespaces service not found")
|
||||
}
|
||||
i, err := p.Instance()
|
||||
i, err := ic.GetByID(plugins.ServicePlugin, services.NamespacesService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
// Config for the opt manager
|
||||
|
||||
@@ -18,7 +18,6 @@ package sandbox
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -29,13 +28,13 @@ import (
|
||||
api "github.com/containerd/containerd/v2/api/services/sandbox/v1"
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/events"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/protobuf"
|
||||
"github.com/containerd/containerd/v2/sandbox"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -47,20 +46,12 @@ func init() {
|
||||
plugins.EventPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
plugs, err := ic.GetByType(plugins.ServicePlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p, ok := plugs[services.SandboxControllersService]
|
||||
if !ok {
|
||||
return nil, errors.New("sandboxes service not found")
|
||||
}
|
||||
i, err := p.Instance()
|
||||
i, err := ic.GetByID(plugins.ServicePlugin, services.SandboxControllersService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sc := i.(map[string]sandbox.Controller)
|
||||
ep, err := ic.Get(plugins.EventPlugin)
|
||||
ep, err := ic.GetSingle(plugins.EventPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
package sandbox
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/sandbox"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -38,11 +38,7 @@ func init() {
|
||||
}
|
||||
sandboxers := make(map[string]sandbox.Controller)
|
||||
for name, srv := range sandboxesRaw {
|
||||
inst, err := srv.Instance()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sandboxers[name] = inst.(sandbox.Controller)
|
||||
sandboxers[name] = srv.(sandbox.Controller)
|
||||
}
|
||||
return sandboxers, nil
|
||||
},
|
||||
|
||||
@@ -24,11 +24,11 @@ import (
|
||||
api "github.com/containerd/containerd/v2/api/services/sandbox/v1"
|
||||
"github.com/containerd/containerd/v2/api/types"
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/sandbox"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -36,8 +36,8 @@ import (
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
)
|
||||
|
||||
// CurrentConfigVersion is the max config version which is supported
|
||||
|
||||
@@ -59,15 +59,15 @@ import (
|
||||
"github.com/containerd/containerd/v2/pkg/dialer"
|
||||
"github.com/containerd/containerd/v2/pkg/timeout"
|
||||
"github.com/containerd/containerd/v2/platforms"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/dynamic"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
sbproxy "github.com/containerd/containerd/v2/sandbox/proxy"
|
||||
srvconfig "github.com/containerd/containerd/v2/services/server/config"
|
||||
"github.com/containerd/containerd/v2/services/warning"
|
||||
ssproxy "github.com/containerd/containerd/v2/snapshots/proxy"
|
||||
"github.com/containerd/containerd/v2/sys"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/dynamic"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
// CreateTopLevelDirectories creates the top-level root and state directories.
|
||||
@@ -341,9 +341,9 @@ func New(ctx context.Context, config *srvconfig.Config) (*Server, error) {
|
||||
// recordConfigDeprecations attempts to record use of any deprecated config field. Failures are logged and ignored.
|
||||
func recordConfigDeprecations(ctx context.Context, config *srvconfig.Config, set *plugin.Set) {
|
||||
// record any detected deprecations without blocking server startup
|
||||
plugin, err := set.GetByID(plugins.WarningPlugin, plugins.DeprecationsPlugin)
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Warn("failed to load warning service to record deprecations")
|
||||
plugin := set.Get(plugins.WarningPlugin, plugins.DeprecationsPlugin)
|
||||
if plugin == nil {
|
||||
log.G(ctx).Warn("failed to find warning service to record deprecations")
|
||||
return
|
||||
}
|
||||
instance, err := plugin.Instance()
|
||||
|
||||
@@ -20,9 +20,9 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
srvconfig "github.com/containerd/containerd/v2/services/server/config"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -18,18 +18,17 @@ package snapshots
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
snapshotsapi "github.com/containerd/containerd/v2/api/services/snapshots/v1"
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/mount"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/containerd/v2/snapshots"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -52,20 +51,11 @@ type service struct {
|
||||
}
|
||||
|
||||
func newService(ic *plugin.InitContext) (interface{}, error) {
|
||||
sps, err := ic.GetByType(plugins.ServicePlugin)
|
||||
i, err := ic.GetByID(plugins.ServicePlugin, services.SnapshotsService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p, ok := sps[services.SnapshotsService]
|
||||
if !ok {
|
||||
return nil, errors.New("snapshots service not found")
|
||||
}
|
||||
i, err := p.Instance()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ss := i.(map[string]snapshots.Snapshotter)
|
||||
return &service{ss: ss}, nil
|
||||
return &service{ss: i.(map[string]snapshots.Snapshotter)}, nil
|
||||
}
|
||||
|
||||
func (s *service) getSnapshotter(name string) (snapshots.Snapshotter, error) {
|
||||
|
||||
@@ -18,10 +18,10 @@ package snapshots
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/v2/metadata"
|
||||
"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"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -32,7 +32,7 @@ func init() {
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
m, err := ic.Get(plugins.MetadataPlugin)
|
||||
m, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -23,12 +23,12 @@ import (
|
||||
api "github.com/containerd/containerd/v2/api/services/streaming/v1"
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/pkg/streaming"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/protobuf"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -41,8 +41,6 @@ import (
|
||||
"github.com/containerd/containerd/v2/pkg/blockio"
|
||||
"github.com/containerd/containerd/v2/pkg/rdt"
|
||||
"github.com/containerd/containerd/v2/pkg/timeout"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/protobuf"
|
||||
"github.com/containerd/containerd/v2/protobuf/proto"
|
||||
@@ -51,6 +49,8 @@ import (
|
||||
"github.com/containerd/containerd/v2/runtime/v2/runc/options"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
"github.com/opencontainers/go-digest"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
@@ -96,17 +96,17 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
m, err := ic.Get(plugins.MetadataPlugin)
|
||||
m, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ep, err := ic.Get(plugins.EventPlugin)
|
||||
ep, err := ic.GetSingle(plugins.EventPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
monitor, err := ic.Get(plugins.TaskMonitorPlugin)
|
||||
monitor, err := ic.GetSingle(plugins.TaskMonitorPlugin)
|
||||
if err != nil {
|
||||
if !errors.Is(err, plugin.ErrPluginNotFound) {
|
||||
return nil, err
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/plugin"
|
||||
)
|
||||
|
||||
var tasksServiceRequires = []plugin.Type{
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/plugin"
|
||||
)
|
||||
|
||||
var tasksServiceRequires = []plugin.Type{
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/plugin"
|
||||
)
|
||||
|
||||
var tasksServiceRequires = []plugin.Type{
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/plugin"
|
||||
)
|
||||
|
||||
var tasksServiceRequires = []plugin.Type{
|
||||
|
||||
@@ -18,14 +18,13 @@ package tasks
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
api "github.com/containerd/containerd/v2/api/services/tasks/v1"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/containerd/v2/services"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -41,15 +40,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.TasksService]
|
||||
if !ok {
|
||||
return nil, errors.New("tasks service not found")
|
||||
}
|
||||
i, err := p.Instance()
|
||||
i, err := ic.GetByID(plugins.ServicePlugin, services.TasksService)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ import (
|
||||
"github.com/containerd/containerd/v2/pkg/streaming"
|
||||
"github.com/containerd/containerd/v2/pkg/transfer"
|
||||
tplugins "github.com/containerd/containerd/v2/pkg/transfer/plugins"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
@@ -64,11 +64,7 @@ func newService(ic *plugin.InitContext) (interface{}, error) {
|
||||
// TODO: how to determine order?
|
||||
t := make([]transfer.Transferrer, 0, len(sps))
|
||||
for _, p := range sps {
|
||||
i, err := p.Instance()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
t = append(t, i.(transfer.Transferrer))
|
||||
t = append(t, p.(transfer.Transferrer))
|
||||
}
|
||||
sp, err := ic.GetByID(plugins.StreamingPlugin, "manager")
|
||||
if err != nil {
|
||||
|
||||
@@ -20,11 +20,11 @@ import (
|
||||
"context"
|
||||
|
||||
api "github.com/containerd/containerd/v2/api/services/version/v1"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
ptypes "github.com/containerd/containerd/v2/protobuf/types"
|
||||
ctrdversion "github.com/containerd/containerd/v2/version"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ import (
|
||||
"github.com/containerd/log"
|
||||
|
||||
deprecation "github.com/containerd/containerd/v2/pkg/deprecation"
|
||||
"github.com/containerd/containerd/v2/plugin"
|
||||
"github.com/containerd/containerd/v2/plugin/registry"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
)
|
||||
|
||||
type Service interface {
|
||||
|
||||
Reference in New Issue
Block a user