-
Notifications
You must be signed in to change notification settings - Fork 434
/
ip.go
32 lines (28 loc) · 838 Bytes
/
ip.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package controller
import (
"k8s.io/klog/v2"
kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1"
)
func (c *Controller) enqueueAddOrDelIP(obj interface{}) {
if !c.isLeader() {
return
}
ipObj := obj.(*kubeovnv1.IP)
klog.V(3).Infof("enqueue update status subnet %s", ipObj.Spec.Subnet)
c.updateSubnetStatusQueue.Add(ipObj.Spec.Subnet)
for _, as := range ipObj.Spec.AttachSubnets {
klog.V(3).Infof("enqueue update status subnet %s", as)
c.updateSubnetStatusQueue.Add(as)
}
}
func (c *Controller) enqueueUpdateIP(old, new interface{}) {
if !c.isLeader() {
return
}
ipObj := new.(*kubeovnv1.IP)
klog.V(3).Infof("enqueue update status subnet %s", ipObj.Spec.Subnet)
for _, as := range ipObj.Spec.AttachSubnets {
klog.V(3).Infof("enqueue update status subnet %s", as)
c.updateSubnetStatusQueue.Add(as)
}
}