Skip to content

Commit 3fd2e07

Browse files
committed
simple vip lable update and then update subnet status (#5036)
Signed-off-by: zbb88888 <jmdxjsjgcxy@gmail.com>
1 parent a8be198 commit 3fd2e07

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
@@ -297,7 +297,6 @@ func (c *Controller) handleAddVirtualIP(key string) error {
297297
klog.Error(err)
298298
return err
299299
}
300-
c.updateSubnetStatusQueue.Add(subnetName)
301300
return nil
302301
}
303302

@@ -536,13 +535,9 @@ func (c *Controller) createOrUpdateVipCR(key, ns, subnet, v4ip, v6ip, mac, pV4ip
536535
}
537536
needUpdateLabel = true
538537
}
539-
if vip.Labels[util.SubnetNameLabel] != subnet {
540-
op = "replace"
541-
vip.Labels[util.SubnetNameLabel] = subnet
542-
needUpdateLabel = true
543-
}
544-
if _, ok := vip.Labels[util.IPReservedLabel]; !ok {
538+
if _, ok := vip.Labels[util.SubnetNameLabel]; !ok {
545539
op = "add"
540+
vip.Labels[util.SubnetNameLabel] = subnet
546541
vip.Labels[util.IPReservedLabel] = ""
547542
needUpdateLabel = true
548543
}
@@ -557,6 +552,7 @@ func (c *Controller) createOrUpdateVipCR(key, ns, subnet, v4ip, v6ip, mac, pV4ip
557552
}
558553
}
559554
}
555+
c.updateSubnetStatusQueue.Add(subnet)
560556
return nil
561557
}
562558

0 commit comments

Comments
 (0)