From 013196141c40f56207b376eeef8aabcc08cd124c Mon Sep 17 00:00:00 2001 From: bobz965 Date: Wed, 24 Jan 2024 12:58:35 +0800 Subject: [PATCH] fix: golangci lint Signed-off-by: bobz965 --- pkg/controller/ip.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/controller/ip.go b/pkg/controller/ip.go index b29055742e3f..a7e34da0d1bb 100644 --- a/pkg/controller/ip.go +++ b/pkg/controller/ip.go @@ -496,16 +496,17 @@ func (c *Controller) createOrUpdateCrdIPs(ipCRName, podName, ip, mac, subnetName return nil } - _, err := c.config.KubeOvnClient.KubeovnV1().IPs().Update(context.Background(), newIPCR, metav1.UpdateOptions{}) + ipCR, err = c.config.KubeOvnClient.KubeovnV1().IPs().Update(context.Background(), newIPCR, metav1.UpdateOptions{}) if err != nil { err := fmt.Errorf("failed to update ip CR %s: %v", newIPCR.Name, err) klog.Error(err) return err } - if err := c.handleAddIPFinalizer(ipCR, util.ControllerName); err != nil { - klog.Errorf("failed to handle add ip finalizer %v", err) - return err - } + } + + if err := c.handleAddIPFinalizer(ipCR, util.ControllerName); err != nil { + klog.Errorf("failed to handle add ip finalizer %v", err) + return err } return nil