diff --git a/pkg/controller/pod.go b/pkg/controller/pod.go index 2d145deb73f..3c1a70c0cff 100644 --- a/pkg/controller/pod.go +++ b/pkg/controller/pod.go @@ -508,7 +508,7 @@ func (c *Controller) getPodKubeovnNets(pod *v1.Pod) ([]*kubeovnNet, error) { func (c *Controller) changeVMSubnet(vmName, namespace, providerName, subnetName string) error { ipName := ovs.PodNameToPortName(vmName, namespace, providerName) - ipCr, err := c.ipsLister.Get(ipName) + ipCR, err := c.ipsLister.Get(ipName) if err != nil { if k8serrors.IsNotFound(err) { return nil @@ -517,10 +517,10 @@ func (c *Controller) changeVMSubnet(vmName, namespace, providerName, subnetName klog.Error(err) return err } - if ipCr.Spec.Subnet != subnetName { + if ipCR.Spec.Subnet != subnetName { key := fmt.Sprintf("%s/%s", namespace, vmName) - klog.Infof("release ipam for vm %s from old subnet %s", key, ipCr.Spec.Subnet) - c.ipam.ReleaseAddressByPod(key, ipCr.Spec.Subnet) + klog.Infof("release ipam for vm %s from old subnet %s", key, ipCR.Spec.Subnet) + c.ipam.ReleaseAddressByPod(key, ipCR.Spec.Subnet) klog.Infof("gc logical switch port %s", key) if err := c.OVNNbClient.DeleteLogicalSwitchPort(key); err != nil { klog.Errorf("failed to delete lsp %s, %v", key, err) diff --git a/pkg/ovs/ovn-nb-load_balancer.go b/pkg/ovs/ovn-nb-load_balancer.go index 134b8b49306..217c434d84a 100644 --- a/pkg/ovs/ovn-nb-load_balancer.go +++ b/pkg/ovs/ovn-nb-load_balancer.go @@ -153,11 +153,9 @@ func (c *OVNNbClient) LoadBalancerDeleteVip(lbName, vipEndpoint string, ignoreHe return err } - if lbhc != nil { - if err = c.LoadBalancerDeleteHealthCheck(lbName, lbhc.UUID); err != nil { - klog.Errorf("failed to delete lb health check: %v", err) - return err - } + if err = c.LoadBalancerDeleteHealthCheck(lbName, lbhc.UUID); err != nil { + klog.Errorf("failed to delete lb health check: %v", err) + return err } } if lb == nil || len(lb.Vips) == 0 {