modify ippool api resource to namespace scope
sync namespace annotation when ippool is deleting Signed-off-by: Duan Jiong <djduanjiong@gmail.com>
This commit is contained in:
@@ -402,7 +402,9 @@ func (c *IPPoolController) processNS(name string) error {
|
||||
}
|
||||
|
||||
for _, pool := range pools {
|
||||
poolsName = append(poolsName, pool.Name)
|
||||
if pool.Status.Synced {
|
||||
poolsName = append(poolsName, pool.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -534,6 +536,19 @@ func NewIPPoolController(
|
||||
}
|
||||
c.enqueueIPPools(new)
|
||||
},
|
||||
DeleteFunc: func(new interface{}) {
|
||||
_, defaultNew := new.(*networkv1alpha1.IPPool).Labels[networkv1alpha1.IPPoolDefaultLabel]
|
||||
if defaultNew {
|
||||
nss, err := c.nsInformer.Lister().List(labels.Everything())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, ns := range nss {
|
||||
c.enqueueNamespace(nil, ns)
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
//just for update ippool status
|
||||
|
||||
Reference in New Issue
Block a user