sandbox: podsandbox init its own client
To break the cyclic dependency of cri plugin and podsandbox plugin, we define a new plugin type of SandboxesServicePlugin and when cri init it's own client, it will add the all the controllers by get them from the SandboxesServicePlugin. when podsandbox controller init it's client, it will not Require the SandboxesServicePlugin. Signed-off-by: Abel Feng <fshb1988@gmail.com>
This commit is contained in:
		| @@ -42,11 +42,11 @@ func init() { | ||||
| 		Type: plugins.GRPCPlugin, | ||||
| 		ID:   "sandbox-controllers", | ||||
| 		Requires: []plugin.Type{ | ||||
| 			plugins.ServicePlugin, | ||||
| 			plugins.SandboxesServicePlugin, | ||||
| 			plugins.EventPlugin, | ||||
| 		}, | ||||
| 		InitFn: func(ic *plugin.InitContext) (interface{}, error) { | ||||
| 			i, err := ic.GetByID(plugins.ServicePlugin, services.SandboxControllersService) | ||||
| 			i, err := ic.GetByID(plugins.SandboxesServicePlugin, services.SandboxControllersService) | ||||
| 			if err != nil { | ||||
| 				return nil, err | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Abel Feng
					Abel Feng