MCPcopy
hub / github.com/containerd/containerd / waitContainerStop

Method waitContainerStop

internal/cri/server/container_stop.go:253–260  ·  view source on GitHub ↗

waitContainerStop waits for container to be stopped until context is cancelled or the context deadline is exceeded.

(ctx context.Context, container containerstore.Container)

Source from the content-addressed store, hash-verified

251// waitContainerStop waits for container to be stopped until context is
252// cancelled or the context deadline is exceeded.
253func (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.
263func (c *criService) cleanupUnknownContainer(ctx context.Context, id string, cntr containerstore.Container, sandboxID string) error {

Callers 2

stopContainerMethod · 0.95
TestWaitContainerStopFunction · 0.80

Implementers 1

criServiceinternal/cri/server/service.go

Calls 3

StoppedMethod · 0.80
DoneMethod · 0.65
ErrMethod · 0.65

Tested by 1

TestWaitContainerStopFunction · 0.64