Skip to content

Commit

Permalink
resolve review problem
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Aug 27, 2020
1 parent e779a09 commit c5ca0b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 6 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ func (c *Controller) startWorkers(stopCh <-chan struct{}) {
go wait.Until(c.runDeleteNodeWorker, time.Second, stopCh)
}
for {
ready := true
time.Sleep(3 * time.Second)
nodes, err := c.nodesLister.List(labels.Everything())
if err != nil {
Expand All @@ -338,10 +339,13 @@ func (c *Controller) startWorkers(stopCh <-chan struct{}) {
for _, node := range nodes {
if node.Annotations[util.AllocatedAnnotation] != "true" {
klog.Infof("wait node %s annotation ready", node.Name)
continue
ready = false
break
}
}
break
if ready == true {
break
}
}

// run in a single worker to avoid subnet cidr conflict
Expand Down
9 changes: 5 additions & 4 deletions pkg/controller/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package controller

import (
"fmt"
"strings"
"time"

"github.com/alauda/kube-ovn/pkg/ovs"
"github.com/alauda/kube-ovn/pkg/util"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/klog"
"strings"
"time"
)

var lastNoPodLSP map[string]bool
Expand Down Expand Up @@ -181,9 +182,9 @@ func (c *Controller) gcLoadBalancer() error {
}
} else {
if svc.Spec.SessionAffinity == corev1.ServiceAffinityClientIP {
tcpSessionVips = append(udpSessionVips, fmt.Sprintf("%s:%d", ip, port.Port))
udpSessionVips = append(udpSessionVips, fmt.Sprintf("%s:%d", ip, port.Port))
} else {
tcpVips = append(udpVips, fmt.Sprintf("%s:%d", ip, port.Port))
udpVips = append(udpVips, fmt.Sprintf("%s:%d", ip, port.Port))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (c *Controller) InitOVN() error {
return nil
}

// InitDefaultLogicalSwitch int the default logical switch for ovn network
// InitDefaultLogicalSwitch init the default logical switch for ovn network
func (c *Controller) initDefaultLogicalSwitch() error {
_, err := c.config.KubeOvnClient.KubeovnV1().Subnets().Get(c.config.DefaultLogicalSwitch, v1.GetOptions{})
if err == nil {
Expand Down

0 comments on commit c5ca0b1

Please sign in to comment.