Stop the containerd server canceling any open connections
()
| 268 | |
| 269 | // Stop the containerd server canceling any open connections |
| 270 | func (s *Server) Stop() { |
| 271 | for i := len(s.plugins) - 1; i >= 0; i-- { |
| 272 | p := s.plugins[i] |
| 273 | instance, err := p.Instance() |
| 274 | if err != nil { |
| 275 | log.L.WithFields(log.Fields{"error": err, "id": p.Registration.URI()}).Error("could not get plugin instance") |
| 276 | continue |
| 277 | } |
| 278 | closer, ok := instance.(io.Closer) |
| 279 | if !ok { |
| 280 | continue |
| 281 | } |
| 282 | if err := closer.Close(); err != nil { |
| 283 | log.L.WithFields(log.Fields{"error": err, "id": p.Registration.URI()}).Error("failed to close plugin") |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | func (s *Server) RegisterReadiness() func() { |
| 289 | s.ready.Add(1) |
no test coverage detected