Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix backport #4066

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions pkg/ovs/ovn-nb-load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading