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

Commit 57d713a

Browse files
committed
cleanup the sandbox after it exited
Signed-off-by: fupan <[email protected]>
1 parent 29b7d94 commit 57d713a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: daemon/pod/decommission.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ func (p *XPod) ForceQuit() {
4949
}
5050

5151
func (p *XPod) Remove(force bool) error {
52+
var err error
5253

5354
if p.IsRunning() {
5455
if !force {
55-
err := fmt.Errorf("pod is running, cannot be removed")
56+
err = fmt.Errorf("pod is running, cannot be removed")
5657
p.Log(ERROR, err)
5758
return err
5859
}
@@ -624,6 +625,11 @@ func (p *XPod) decommissionResources() (err error) {
624625
}
625626
}
626627

628+
err = p.sandbox.Delete()
629+
if err != nil {
630+
p.Log(ERROR, "remove sandbox failed: %v", err)
631+
}
632+
627633
p.sandbox = nil
628634

629635
cleanupHosts(p.Id())

0 commit comments

Comments
 (0)