Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 8b8b045

Browse files
committed
using the sandbox api instead of vc api
using the sandbox api instead of vc api to send signal to container; To check the returned err for monitoring the vm. Signed-off-by: fupan <lifupan@gmail.com>
1 parent 07ed00b commit 8b8b045

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

daemon/pod/decommission.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func (p *XPod) KillContainer(id string, sig int64) error {
177177
c.setKill()
178178
return p.protectedSandboxOperation(
179179
func(sb *vc.Sandbox) error {
180-
return vc.KillContainer(sb.ID(), id, syscall.Signal(sig), true)
180+
return sb.SignalProcess(id, id, syscall.Signal(sig), true)
181181
},
182182
time.Second*5,
183183
fmt.Sprintf("Kill container %s with %d", id, sig))
@@ -531,9 +531,14 @@ func (p *XPod) waitVMStop() {
531531
}
532532
p.statusLock.RUnlock()
533533

534-
monitor, _ := p.sandbox.Monitor()
535-
_ = <-monitor
536-
p.Log(INFO, "got vm exit event")
534+
monitor, err := p.sandbox.Monitor()
535+
if err != nil {
536+
p.Log(INFO, "cannot monitor the vm, %v", err)
537+
} else {
538+
_ = <-monitor
539+
p.Log(INFO, "got vm exit event")
540+
}
541+
537542
p.cleanup()
538543
}
539544

0 commit comments

Comments
 (0)