Do not SIGKILL container if container stop is cancelled.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-03-27 00:49:41 -07:00
parent bb58b1dbb0
commit 1a0228d520
3 changed files with 71 additions and 4 deletions

View File

@@ -144,7 +144,7 @@ func (c *criService) waitSandboxStop(ctx context.Context, sandbox sandboxstore.S
defer timeoutTimer.Stop()
select {
case <-ctx.Done():
return errors.Errorf("wait sandbox container %q is cancelled", sandbox.ID)
return errors.Wrapf(ctx.Err(), "wait sandbox container %q is cancelled", sandbox.ID)
case <-timeoutTimer.C:
return errors.Errorf("wait sandbox container %q stop timeout", sandbox.ID)
case <-sandbox.Stopped():