Skip to content

Commit

Permalink
fix ips update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Mar 1, 2022
1 parent fe9532d commit f053f2a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/daemon/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,11 @@ func (csh cniServerHandler) createOrUpdateIPCr(podRequest request.CniRequest, su
}
} else {
ipCr := oriIpCr.DeepCopy()
ipCr.Spec.AttachIPs = append(ipCr.Spec.AttachIPs, ip)
ipCr.Spec.NodeName = csh.Config.NodeName
ipCr.Spec.AttachIPs = []string{}
ipCr.Labels[subnet] = ""
ipCr.Spec.AttachSubnets = append(ipCr.Spec.AttachSubnets, subnet)
ipCr.Spec.AttachMacs = append(ipCr.Spec.AttachMacs, macAddr)
ipCr.Spec.AttachSubnets = []string{}
ipCr.Spec.AttachMacs = []string{}
if _, err := csh.KubeOvnClient.KubeovnV1().IPs().Update(context.Background(), ipCr, metav1.UpdateOptions{}); err != nil {
errMsg := fmt.Errorf("failed to update ip crd for %s, %v", ip, err)
klog.Error(errMsg)
Expand Down

0 comments on commit f053f2a

Please sign in to comment.