sandbox: support force stop

When force is true, ignore any guest related errors. This can
be used to stop a sandbox when hypervisor process is dead.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao
2019-07-19 00:40:34 -07:00
parent 4130913ed7
commit bc4460e12f
12 changed files with 32 additions and 31 deletions

View File

@@ -152,7 +152,7 @@ func kill(ctx context.Context, containerID, signal string, all bool) error {
switch containerType {
case vc.PodSandbox:
_, err = vci.StopSandbox(ctx, sandboxID)
_, err = vci.StopSandbox(ctx, sandboxID, signum == syscall.SIGKILL)
case vc.PodContainer:
_, err = vci.StopContainer(ctx, sandboxID, containerID)
default: