Skip to content

Commit

Permalink
add kubevirt multus nic lsp before gc process (#2504)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Mar 20, 2023
1 parent 3fc6d8e commit 6fb7992
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/controller/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,17 @@ func (c *Controller) getVmLsps() []string {
for _, vm := range vms.Items {
vmLsp := ovs.PodNameToPortName(vm.Name, ns.Name, util.OvnProvider)
vmLsps = append(vmLsps, vmLsp)

attachNets, err := util.ParsePodNetworkAnnotation(vm.Spec.Template.ObjectMeta.Annotations[util.AttachmentNetworkAnnotation], vm.Namespace)
if err != nil {
klog.Errorf("failed to get attachment subnet of vm %s, %v", vm.Name, err)
continue
}
for _, multiNet := range attachNets {
provider := fmt.Sprintf("%s.%s.ovn", multiNet.Name, multiNet.Namespace)
vmLsp := ovs.PodNameToPortName(vm.Name, ns.Name, provider)
vmLsps = append(vmLsps, vmLsp)
}
}
}
}
Expand Down

0 comments on commit 6fb7992

Please sign in to comment.