mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Nil check ingressSandbox before deleting
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
This commit is contained in:
parent
24f44d9732
commit
9041996509
1 changed files with 7 additions and 4 deletions
|
@ -320,14 +320,17 @@ func (c *controller) clusterAgentInit() {
|
||||||
c.agentClose()
|
c.agentClose()
|
||||||
c.cleanupServiceBindings("")
|
c.cleanupServiceBindings("")
|
||||||
|
|
||||||
if err := c.ingressSandbox.Delete(); err != nil {
|
|
||||||
log.Warnf("Could not delete ingress sandbox while leaving: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
c.Lock()
|
c.Lock()
|
||||||
|
ingressSandbox := c.ingressSandbox
|
||||||
c.ingressSandbox = nil
|
c.ingressSandbox = nil
|
||||||
c.Unlock()
|
c.Unlock()
|
||||||
|
|
||||||
|
if ingressSandbox != nil {
|
||||||
|
if err := ingressSandbox.Delete(); err != nil {
|
||||||
|
log.Warnf("Could not delete ingress sandbox while leaving: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
n, err := c.NetworkByName("ingress")
|
n, err := c.NetworkByName("ingress")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("Could not find ingress network while leaving: %v", err)
|
log.Warnf("Could not find ingress network while leaving: %v", err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue