startInProc initializes an in-process RPC endpoint.
(apis []rpc.API)
| 273 | |
| 274 | // startInProc initializes an in-process RPC endpoint. |
| 275 | func (n *Node) startInProc(apis []rpc.API) error { |
| 276 | // Register all the APIs exposed by the services |
| 277 | handler := rpc.NewServer() |
| 278 | for _, api := range apis { |
| 279 | if api.Namespace == "admission" { |
| 280 | api.Service.(admission.ApiBackend).RegisterInProcHandler(handler) |
| 281 | } |
| 282 | if err := handler.RegisterName(api.Namespace, api.Service); err != nil { |
| 283 | return err |
| 284 | } |
| 285 | n.log.Debug("InProc registered", "service", api.Service, "namespace", api.Namespace) |
| 286 | } |
| 287 | n.inprocHandler = handler |
| 288 | return nil |
| 289 | } |
| 290 | |
| 291 | // stopInProc terminates the in-process RPC endpoint. |
| 292 | func (n *Node) stopInProc() { |
no test coverage detected