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

Commit

Permalink
decommission: do sanity check for pod.sandpox pointer
Browse files Browse the repository at this point in the history
Signed-off-by: fupan <[email protected]>
  • Loading branch information
lifupan committed Jul 11, 2018
1 parent a5841be commit 53bf002
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions daemon/pod/decommission.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,14 @@ func (p *XPod) decommissionResources() (err error) {
}
}

err = p.sandbox.Delete()
if err != nil {
p.Log(ERROR, "remove sandbox failed: %v", err)
if p.sandbox != nil {
err = p.sandbox.Delete()
if err != nil {
p.Log(ERROR, "remove sandbox failed: %v", err)
}
p.sandbox = nil
}

p.sandbox = nil

cleanupHosts(p.Id())
// then it could be start again.
p.factory.hosts = HostsCreator(p.Id())
Expand Down

0 comments on commit 53bf002

Please sign in to comment.