diff --git a/runtime/v2/manager.go b/runtime/v2/manager.go index b7bd9bf95..708310aeb 100644 --- a/runtime/v2/manager.go +++ b/runtime/v2/manager.go @@ -96,6 +96,24 @@ func init() { return NewTaskManager(shimManager), nil }, }) + + // Task manager uses shim manager as a dependency to manage shim instances. + // However, due to time limits and to avoid migration steps in 1.6 release, + // use the following workaround. + // This expected to be removed in 1.7. + plugin.Register(&plugin.Registration{ + Type: plugin.RuntimePluginV2, + ID: "shim", + InitFn: func(ic *plugin.InitContext) (interface{}, error) { + taskManagerI, err := ic.GetByID(plugin.RuntimePluginV2, "task") + if err != nil { + return nil, err + } + + taskManager := taskManagerI.(*TaskManager) + return taskManager.manager, nil + }, + }) } type ManagerConfig struct { diff --git a/services/sandbox/controller_local.go b/services/sandbox/controller_local.go index 968e04ba7..e01124bee 100644 --- a/services/sandbox/controller_local.go +++ b/services/sandbox/controller_local.go @@ -41,12 +41,12 @@ func init() { Type: plugin.ServicePlugin, ID: services.SandboxControllerService, Requires: []plugin.Type{ - plugin.RuntimeShimPlugin, + plugin.RuntimePluginV2, plugin.MetadataPlugin, plugin.EventPlugin, }, InitFn: func(ic *plugin.InitContext) (interface{}, error) { - shimPlugin, err := ic.Get(plugin.RuntimeShimPlugin) + shimPlugin, err := ic.GetByID(plugin.RuntimePluginV2, "shim") if err != nil { return nil, err }