Skip to content

Commit

Permalink
add srl connectivity test
Browse files Browse the repository at this point in the history
  • Loading branch information
bobz965 committed Jul 20, 2023
1 parent 42f35a3 commit c6b87d2
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 136 deletions.
4 changes: 3 additions & 1 deletion pkg/controller/endpoint.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit c6b87d2

Please sign in to comment.