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

Commit f39876a

Browse files
committed
XPod: doStopPod: call removeFromSandbox with every p.containers
Some resource for containers needs to be released before p.sandbox.Shutdown. Add this patch to call removeFromSandbox with every p.containers before p.sandbox.Shutdown to release the resource. Signed-off-by: Hui Zhu <teawater@hyper.sh>
1 parent 58697a4 commit f39876a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

daemon/pod/decommission.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,13 @@ func (p *XPod) doStopPod(graceful int) error {
382382
return nil
383383
}
384384

385+
for cid, c := range p.containers {
386+
err = c.removeFromSandbox()
387+
if err != nil {
388+
c.Log(ERROR, "failed to remove %s from sandbox", cid)
389+
}
390+
}
391+
385392
p.Log(INFO, "stop container success, shutdown sandbox")
386393
result := p.sandbox.Shutdown()
387394
if result.IsSuccess() {

0 commit comments

Comments
 (0)