Merge pull request #3376 from duanjiong/ippool
Don't exit while synchronizing calico ippool
This commit is contained in:
@@ -339,12 +339,14 @@ func (c *IPPoolController) processIPPoolItem() bool {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
c.ippoolQueue.Forget(key)
|
c.ippoolQueue.Forget(key)
|
||||||
return true
|
return true
|
||||||
} else if delay != nil {
|
|
||||||
c.ippoolQueue.AddAfter(key, *delay)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if delay != nil {
|
||||||
|
c.ippoolQueue.AddAfter(key, *delay)
|
||||||
|
} else {
|
||||||
|
c.ippoolQueue.AddRateLimited(key)
|
||||||
|
}
|
||||||
utilruntime.HandleError(fmt.Errorf("error processing ippool %v (will retry): %v", key, err))
|
utilruntime.HandleError(fmt.Errorf("error processing ippool %v (will retry): %v", key, err))
|
||||||
c.ippoolQueue.AddRateLimited(key)
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -695,9 +695,16 @@ func NewProvider(podInformer informercorev1.PodInformer, ksclient kubesphereclie
|
|||||||
})
|
})
|
||||||
p.block = blockI
|
p.block = blockI
|
||||||
|
|
||||||
if err := p.syncIPPools(); err != nil {
|
go func() {
|
||||||
klog.Fatalf("failed to sync calico ippool to kubesphere ippool, err=%v", err)
|
for {
|
||||||
}
|
if err := p.syncIPPools(); err != nil {
|
||||||
|
klog.Infof("failed to sync calico ippool to kubesphere ippool, err=%v", err)
|
||||||
|
time.Sleep(3 * time.Second)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user