Skip to content

Commit

Permalink
fix: lsp define in nb is not clear when delete vm
Browse files Browse the repository at this point in the history
Signed-off-by: wujixin <[email protected]>
  • Loading branch information
wujixin committed Nov 16, 2023
1 parent 024b95e commit 3ccdd7e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,13 @@ func (c *Controller) handleDeletePod(key string) error {
}
}

ports, err := c.OVNNbClient.ListNormalLogicalSwitchPorts(true, map[string]string{"pod": key})
isVMPod, vmName := isVMPod(pod)
podkey := key
if isVMPod {
podkey = vmName
}

ports, err := c.OVNNbClient.ListNormalLogicalSwitchPorts(true, map[string]string{"pod": podkey})
if err != nil {
klog.Errorf("failed to list lsps of pod '%s', %v", pod.Name, err)
return err
Expand Down Expand Up @@ -1057,7 +1063,7 @@ func (c *Controller) handleDeletePod(key string) error {
}
keepIPCR = !toDel && !isDelete && err == nil
}
isVMPod, vmName := isVMPod(pod)

if isVMPod && c.config.EnableKeepVMIP {
toDel := c.isVMPodToDel(pod, vmName)
isDelete, err := appendCheckPodToDel(c, pod, vmName, util.VMInstance)
Expand Down

0 comments on commit 3ccdd7e

Please sign in to comment.