diff --git a/daemon/pod/decommission.go b/daemon/pod/decommission.go index 1d38a289..f561cd4c 100644 --- a/daemon/pod/decommission.go +++ b/daemon/pod/decommission.go @@ -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())