Skip to content

Commit

Permalink
fix vip create (#2245)
Browse files Browse the repository at this point in the history
* 1.add job and cronjob check in webhook
2.fix pod check in webhook

* 1. remove debug log

* 修复vip指定了mac无法分配ip

* 修复vip函数入场错误

Co-authored-by: yl4811 <yl4811@yealink.com>
  • Loading branch information
ShaPoHun and yl4811 committed Jan 16, 2023
1 parent dc731ef commit 9092956
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/vip.go
Expand Up @@ -241,10 +241,10 @@ func (c *Controller) handleUpdateVirtualIp(key string) error {
return err
}
// should update
if vip.Status.Mac == "" && vip.Spec.MacAddress == "" {
if vip.Status.Mac == "" {
// TODO:// add vip in its parent port aap list
if err = c.createOrUpdateCrdVip(key, vip.Namespace, vip.Spec.Subnet,
vip.Spec.V6ip, vip.Spec.V6ip, vip.Spec.MacAddress,
vip.Spec.V4ip, vip.Spec.V6ip, vip.Spec.MacAddress,
vip.Spec.ParentV4ip, vip.Spec.ParentV6ip, vip.Spec.MacAddress); err != nil {
return err
}
Expand Down Expand Up @@ -357,7 +357,7 @@ func (c *Controller) createOrUpdateCrdVip(key, ns, subnet, v4ip, v6ip, mac, pV4i
}
} else {
vip := vipCr.DeepCopy()
if vip.Spec.MacAddress == "" && mac != "" {
if vip.Status.Mac == "" && mac != "" {
// vip not support to update, just delete and create
vip.Spec.Namespace = ns
vip.Spec.V4ip = v4ip
Expand Down

0 comments on commit 9092956

Please sign in to comment.