Move plugin type definitions to containerd plugins package

The plugins packages defines the plugins used by containerd.
Move all the types and properties to this package.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-10-12 15:31:45 -07:00
parent cb969085f5
commit a80606bc2d
74 changed files with 429 additions and 314 deletions

View File

@@ -52,7 +52,7 @@ import (
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/pkg/dialer"
"github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/plugins"
ptypes "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker"
@@ -185,7 +185,7 @@ func NewWithConn(conn *grpc.ClientConn, opts ...ClientOpt) (*Client, error) {
c := &Client{
defaultns: copts.defaultns,
conn: conn,
runtime: plugin.RuntimePlugin.String() + "." + runtime.GOOS,
runtime: plugins.RuntimePlugin.String() + "." + runtime.GOOS,
}
if copts.defaultPlatform != nil {
@@ -826,7 +826,7 @@ func (c *Client) getSnapshotter(ctx context.Context, name string) (snapshots.Sna
// GetSnapshotterSupportedPlatforms returns a platform matchers which represents the
// supported platforms for the given snapshotters
func (c *Client) GetSnapshotterSupportedPlatforms(ctx context.Context, snapshotterName string) (platforms.MatchComparer, error) {
filters := []string{fmt.Sprintf("type==%s, id==%s", plugin.SnapshotPlugin, snapshotterName)}
filters := []string{fmt.Sprintf("type==%s, id==%s", plugins.SnapshotPlugin, snapshotterName)}
in := c.IntrospectionService()
resp, err := in.Plugins(ctx, filters)
@@ -857,7 +857,7 @@ func toPlatforms(pt []*apitypes.Platform) []ocispec.Platform {
// GetSnapshotterCapabilities returns the capabilities of a snapshotter.
func (c *Client) GetSnapshotterCapabilities(ctx context.Context, snapshotterName string) ([]string, error) {
filters := []string{fmt.Sprintf("type==%s, id==%s", plugin.SnapshotPlugin, snapshotterName)}
filters := []string{fmt.Sprintf("type==%s, id==%s", plugins.SnapshotPlugin, snapshotterName)}
in := c.IntrospectionService()
resp, err := in.Plugins(ctx, filters)