Skip to content

Commit

Permalink
add srl connectivity test (#3056)
Browse files Browse the repository at this point in the history
* add srl connectivity test

* Update test/e2e/kube-ovn/switch_lb_rule/switch_lb_rule.go

---------

Co-authored-by: 张祖建 <zhangzujian.7@gmail.com>
  • Loading branch information
bobz965 and zhangzujian committed Jul 20, 2023
1 parent 42f35a3 commit 0d1599f
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 143 deletions.
4 changes: 3 additions & 1 deletion pkg/controller/endpoint.go
Expand Up @@ -194,16 +194,18 @@ func (c *Controller) handleUpdateEndpoint(key string) error {

// for performance reason delete lb with no backends
if len(backends) != 0 {
klog.V(3).Infof("update vip %s with backends %s to LB %s", vip, backends, lb)
if err = c.ovnClient.LoadBalancerAddVip(lb, vip, backends...); err != nil {
klog.Errorf("failed to add vip %s with backends %s to LB %s: %v", vip, backends, lb, err)
return err
}
} else {
klog.V(3).Infof("delete vip %s from LB %s", vip, lb)
if err := c.ovnClient.LoadBalancerDeleteVip(lb, vip); err != nil {
klog.Errorf("failed to delete vip %s from LB %s: %v", vip, lb, err)
return err
}

klog.V(3).Infof("delete vip %s from old LB %s", vip, lb)
if err := c.ovnClient.LoadBalancerDeleteVip(oldLb, vip); err != nil {
klog.Errorf("failed to delete vip %s from LB %s: %v", vip, lb, err)
return err
Expand Down
1 change: 0 additions & 1 deletion pkg/controller/service.go
Expand Up @@ -56,7 +56,6 @@ func (c *Controller) enqueueAddService(obj interface{}) {

func (c *Controller) enqueueDeleteService(obj interface{}) {
svc := obj.(*v1.Service)
//klog.V(3).Infof("enqueue delete service %s/%s", svc.Namespace, svc.Name)
klog.Infof("enqueue delete service %s/%s", svc.Namespace, svc.Name)

vip, ok := svc.Annotations[util.SwitchLBRuleVipsAnnotation]
Expand Down
2 changes: 1 addition & 1 deletion pkg/ipam/ipam.go
Expand Up @@ -61,7 +61,7 @@ func (ipam *IPAM) GetRandomAddress(podName, nicName string, mac *string, subnetN
func (ipam *IPAM) GetStaticAddress(podName, nicName, ip string, mac *string, subnetName string, checkConflict bool) (string, string, string, error) {
ipam.mutex.RLock()
defer ipam.mutex.RUnlock()

klog.Infof("allocating static ip %s from subnet %s", ip, subnetName)
if subnet, ok := ipam.Subnets[subnetName]; !ok {
return "", "", "", ErrNoAvailable
} else {
Expand Down

0 comments on commit 0d1599f

Please sign in to comment.