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:
@@ -41,7 +41,7 @@ import (
|
||||
containerstore "github.com/containerd/containerd/pkg/cri/store/container"
|
||||
imagestore "github.com/containerd/containerd/pkg/cri/store/image"
|
||||
runtimeoptions "github.com/containerd/containerd/pkg/runtimeoptions/v1"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/plugins"
|
||||
runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
|
||||
"github.com/containerd/log"
|
||||
)
|
||||
@@ -289,7 +289,7 @@ func generateRuntimeOptions(r criconfig.Runtime) (interface{}, error) {
|
||||
// getRuntimeOptionsType gets empty runtime options by the runtime type name.
|
||||
func getRuntimeOptionsType(t string) interface{} {
|
||||
switch t {
|
||||
case plugin.RuntimeRuncV2:
|
||||
case plugins.RuntimeRuncV2:
|
||||
return &runcoptions.Options{}
|
||||
case runtimeRunhcsV1:
|
||||
return &runhcsoptions.Options{}
|
||||
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
"github.com/containerd/containerd/oci"
|
||||
criconfig "github.com/containerd/containerd/pkg/cri/config"
|
||||
containerstore "github.com/containerd/containerd/pkg/cri/store/container"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/plugins"
|
||||
"github.com/containerd/containerd/protobuf/types"
|
||||
runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
@@ -119,7 +119,7 @@ systemd_cgroup = true
|
||||
no_pivot = true
|
||||
default_runtime_name = "default"
|
||||
[containerd.runtimes.runcv2]
|
||||
runtime_type = "` + plugin.RuntimeRuncV2 + `"
|
||||
runtime_type = "` + plugins.RuntimeRuncV2 + `"
|
||||
`
|
||||
nonNilOpts := `
|
||||
systemd_cgroup = true
|
||||
@@ -134,7 +134,7 @@ systemd_cgroup = true
|
||||
Root = "/runc"
|
||||
NoNewKeyring = true
|
||||
[containerd.runtimes.runcv2]
|
||||
runtime_type = "` + plugin.RuntimeRuncV2 + `"
|
||||
runtime_type = "` + plugins.RuntimeRuncV2 + `"
|
||||
[containerd.runtimes.runcv2.options]
|
||||
BinaryName = "runc"
|
||||
Root = "/runcv2"
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
criconfig "github.com/containerd/containerd/pkg/cri/config"
|
||||
"github.com/containerd/containerd/pkg/systemd"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/plugins"
|
||||
"github.com/stretchr/testify/assert"
|
||||
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
|
||||
)
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
func newFakeRuntimeConfig(runcV2, systemdCgroup bool) criconfig.Runtime {
|
||||
r := criconfig.Runtime{Type: "default", Options: map[string]interface{}{}}
|
||||
if runcV2 {
|
||||
r.Type = plugin.RuntimeRuncV2
|
||||
r.Type = plugins.RuntimeRuncV2
|
||||
if systemdCgroup {
|
||||
r.Options["SystemdCgroup"] = true
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
imagestore "github.com/containerd/containerd/pkg/cri/store/image"
|
||||
snapshotstore "github.com/containerd/containerd/pkg/cri/store/snapshot"
|
||||
"github.com/containerd/containerd/pkg/cri/streaming"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/plugins"
|
||||
"github.com/containerd/containerd/sandbox"
|
||||
"github.com/containerd/go-cni"
|
||||
"github.com/containerd/log"
|
||||
@@ -350,7 +350,7 @@ func (c *criService) register(s *grpc.Server) error {
|
||||
// imageFSPath returns containerd image filesystem path.
|
||||
// Note that if containerd changes directory layout, we also needs to change this.
|
||||
func imageFSPath(rootDir, snapshotter string) string {
|
||||
return filepath.Join(rootDir, plugin.SnapshotPlugin.String()+"."+snapshotter)
|
||||
return filepath.Join(rootDir, plugins.SnapshotPlugin.String()+"."+snapshotter)
|
||||
}
|
||||
|
||||
func loadOCISpec(filename string) (*oci.Spec, error) {
|
||||
|
||||
Reference in New Issue
Block a user