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 and bobz965 committed May 28, 2024
1 parent a874aaf commit 2d667f5
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 @@ -449,6 +449,11 @@ func (c *Controller) createOrUpdateCrdVip(key, ns, subnet, v4ip, v6ip, mac, pV4i
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 2d667f5

Please sign in to comment.