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

Commit 53bf002

Browse files
committed
decommission: do sanity check for pod.sandpox pointer
Signed-off-by: fupan <[email protected]>
1 parent a5841be commit 53bf002

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: daemon/pod/decommission.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -611,13 +611,14 @@ func (p *XPod) decommissionResources() (err error) {
611611
}
612612
}
613613

614-
err = p.sandbox.Delete()
615-
if err != nil {
616-
p.Log(ERROR, "remove sandbox failed: %v", err)
614+
if p.sandbox != nil {
615+
err = p.sandbox.Delete()
616+
if err != nil {
617+
p.Log(ERROR, "remove sandbox failed: %v", err)
618+
}
619+
p.sandbox = nil
617620
}
618621

619-
p.sandbox = nil
620-
621622
cleanupHosts(p.Id())
622623
// then it could be start again.
623624
p.factory.hosts = HostsCreator(p.Id())

0 commit comments

Comments
 (0)