Skip to content

Commit

Permalink
fix: update in svc 1.1.1.1 may del svc 1.1.1.10
Browse files Browse the repository at this point in the history
(cherry picked from commit b2ce6f0)
  • Loading branch information
oilbeater committed Mar 17, 2020
1 parent 63f05e5 commit 0e1670b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/controller/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ func (c *Controller) handleUpdateService(key string) error {
}
}
// for service update
klog.Infof("update service %s/%s", namespace, name)
lbUuid, err := c.ovnClient.FindLoadbalancer(c.config.ClusterTcpLoadBalancer)
if err != nil {
klog.Errorf("failed to get lb %v", err)
Expand All @@ -238,7 +237,7 @@ func (c *Controller) handleUpdateService(key string) error {
}

for vip := range vips {
if strings.HasPrefix(vip, ip) && !util.IsStringIn(vip, tcpVips) {
if strings.Split(vip, ":")[0] == ip && !util.IsStringIn(vip, tcpVips) {
klog.Infof("remove stall vip %s", vip)
err := c.ovnClient.DeleteLoadBalancerVip(vip, c.config.ClusterTcpLoadBalancer)
if err != nil {
Expand Down Expand Up @@ -268,7 +267,7 @@ func (c *Controller) handleUpdateService(key string) error {
}

for vip := range vips {
if strings.HasPrefix(vip, ip) && !util.IsStringIn(vip, udpVips) {
if strings.Split(vip, ":")[0] == ip && !util.IsStringIn(vip, udpVips) {
klog.Infof("remove stall vip %s", vip)
err := c.ovnClient.DeleteLoadBalancerVip(vip, c.config.ClusterUdpLoadBalancer)
if err != nil {
Expand Down

0 comments on commit 0e1670b

Please sign in to comment.