waitContainerStop waits for container to be stopped until context is cancelled or the context deadline is exceeded.
(ctx context.Context, container containerstore.Container)
| 251 | // waitContainerStop waits for container to be stopped until context is |
| 252 | // cancelled or the context deadline is exceeded. |
| 253 | func (c *criService) waitContainerStop(ctx context.Context, container containerstore.Container) error { |
| 254 | select { |
| 255 | case <-ctx.Done(): |
| 256 | return fmt.Errorf("wait container %q: %w", container.ID, ctx.Err()) |
| 257 | case <-container.Stopped(): |
| 258 | return nil |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | // cleanupUnknownContainer cleanup stopped container in unknown state. |
| 263 | func (c *criService) cleanupUnknownContainer(ctx context.Context, id string, cntr containerstore.Container, sandboxID string) error { |