Reconnect re-establishes the GRPC connection to the containerd daemon
()
| 236 | |
| 237 | // Reconnect re-establishes the GRPC connection to the containerd daemon |
| 238 | func (c *Client) Reconnect() error { |
| 239 | if c.connector == nil { |
| 240 | return fmt.Errorf("unable to reconnect to containerd, no connector available: %w", errdefs.ErrUnavailable) |
| 241 | } |
| 242 | c.connMu.Lock() |
| 243 | defer c.connMu.Unlock() |
| 244 | c.conn.Close() |
| 245 | conn, err := c.connector() |
| 246 | if err != nil { |
| 247 | return err |
| 248 | } |
| 249 | c.conn = conn |
| 250 | return nil |
| 251 | } |
| 252 | |
| 253 | // Runtime returns the name of the runtime being used |
| 254 | func (c *Client) Runtime() string { |