Skip to content

Commit

Permalink
fix: add ip_reserved label for vip (#4093)
Browse files Browse the repository at this point in the history
Signed-off-by: zcq98 <zhaocongqi_yewu@cmss.chinamobile.com>
  • Loading branch information
zcq98 authored May 28, 2024
1 parent 2029231 commit 9c98127
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/vip.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,11 @@ func (c *Controller) createOrUpdateVipCR(key, ns, subnet, v4ip, v6ip, mac, pV4ip
vip.Labels[util.SubnetNameLabel] = subnet
needUpdateLabel = true
}
if _, ok := vip.Labels[util.IPReservedLabel]; !ok {
op = "add"
vip.Labels[util.IPReservedLabel] = ""
needUpdateLabel = true
}
if needUpdateLabel {
patchPayloadTemplate := `[{ "op": "%s", "path": "/metadata/labels", "value": %s }]`
raw, _ := json.Marshal(vip.Labels)
Expand Down

0 comments on commit 9c98127

Please sign in to comment.