Skip to content

Commit f2925b0

Browse files
committed
simple vip lable update and then update subnet status
Signed-off-by: zbb88888 <jmdxjsjgcxy@gmail.com>
1 parent fae0f63 commit f2925b0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pkg/controller/vip.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ func (c *Controller) handleAddVirtualIP(key string) error {
146146
klog.Error(err)
147147
return err
148148
}
149-
c.updateSubnetStatusQueue.Add(subnetName)
150149
return nil
151150
}
152151

@@ -385,13 +384,9 @@ func (c *Controller) createOrUpdateVipCR(key, ns, subnet, v4ip, v6ip, mac, pV4ip
385384
}
386385
needUpdateLabel = true
387386
}
388-
if vip.Labels[util.SubnetNameLabel] != subnet {
389-
op = "replace"
390-
vip.Labels[util.SubnetNameLabel] = subnet
391-
needUpdateLabel = true
392-
}
393-
if _, ok := vip.Labels[util.IPReservedLabel]; !ok {
387+
if _, ok := vip.Labels[util.SubnetNameLabel]; !ok {
394388
op = "add"
389+
vip.Labels[util.SubnetNameLabel] = subnet
395390
vip.Labels[util.IPReservedLabel] = ""
396391
needUpdateLabel = true
397392
}
@@ -406,6 +401,7 @@ func (c *Controller) createOrUpdateVipCR(key, ns, subnet, v4ip, v6ip, mac, pV4ip
406401
}
407402
}
408403
}
404+
c.updateSubnetStatusQueue.Add(subnet)
409405
return nil
410406
}
411407

0 commit comments

Comments
 (0)