Merge pull request #1400 from mrjana/lb
Cleanup ingress network and sandbox on leave
This commit is contained in:
commit
bbe19ab902
1 changed files with 18 additions and 0 deletions
|
@ -308,6 +308,24 @@ func (c *controller) clusterAgentInit() {
|
|||
c.clusterConfigAvailable = false
|
||||
c.agentInitDone = make(chan struct{})
|
||||
c.Unlock()
|
||||
|
||||
if err := c.ingressSandbox.Delete(); err != nil {
|
||||
log.Warnf("Could not delete ingress sandbox while leaving: %v", err)
|
||||
}
|
||||
|
||||
c.ingressSandbox = nil
|
||||
|
||||
n, err := c.NetworkByName("ingress")
|
||||
if err != nil {
|
||||
log.Warnf("Could not find ingress network while leaving: %v", err)
|
||||
}
|
||||
|
||||
if n != nil {
|
||||
if err := n.Delete(); err != nil {
|
||||
log.Warnf("Could not delete ingress network while leaving: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
c.agentClose()
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue