cri: remove sandbox controller from client

cri will call sandbox controller from the sandboxService, remove the
dependency of client.

Signed-off-by: Abel Feng <fshb1988@gmail.com>
This commit is contained in:
Abel Feng
2024-05-11 10:23:41 +08:00
parent e4df672ab8
commit fc5086a74d
3 changed files with 3 additions and 29 deletions

View File

@@ -230,27 +230,3 @@ func WithInMemoryServices(ic *plugin.InitContext) Opt {
return nil
}
}
func WithInMemorySandboxControllers(ic *plugin.InitContext) Opt {
return func(c *clientOpts) error {
sc := make(map[string]sandbox.Controller)
sandboxers, err := ic.GetByType(plugins.SandboxControllerPlugin)
if err != nil {
return err
}
for name, p := range sandboxers {
sc[name] = p.(sandbox.Controller)
}
podSandboxers, err := ic.GetByType(plugins.PodSandboxPlugin)
if err != nil {
return err
}
for name, p := range podSandboxers {
sc[name] = p.(sandbox.Controller)
}
c.services.sandboxers = sc
return nil
}
}