Skip to content

Commit 856988a

Browse files
authored
ovn process skip non-ovn subnet (#6018)
Signed-off-by: zbb88888 <jmdxjsjgcxy@gmail.com>
1 parent 5307a23 commit 856988a

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

pkg/controller/kubevirt.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ func (c *Controller) handleAddOrUpdateVMIMigration(key string) error {
155155
}
156156

157157
for _, podNet := range podNets {
158+
// Skip non-OVN subnets that don't create OVN logical switch ports
159+
if !isOvnSubnet(podNet.Subnet) {
160+
continue
161+
}
162+
158163
portName := ovs.PodNameToPortName(vmiMigration.Spec.VMIName, vmiMigration.Namespace, podNet.ProviderName)
159164
srcNodeName := vmi.Status.MigrationState.SourceNode
160165
targetNodeName := vmi.Status.MigrationState.TargetNode

pkg/controller/pod.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,11 @@ func (c *Controller) handleDeletePod(key string) (err error) {
12111211
}
12121212
}
12131213
for _, podNet := range podNets {
1214+
// Skip non-OVN subnets for security group synchronization
1215+
if !isOvnSubnet(podNet.Subnet) {
1216+
continue
1217+
}
1218+
12141219
c.syncVirtualPortsQueue.Add(podNet.Subnet.Name)
12151220
securityGroupAnnotation := pod.Annotations[fmt.Sprintf(util.SecurityGroupAnnotationTemplate, podNet.ProviderName)]
12161221
if securityGroupAnnotation != "" {
@@ -1262,6 +1267,11 @@ func (c *Controller) handleUpdatePodSecurity(key string) error {
12621267

12631268
// associated with security group
12641269
for _, podNet := range podNets {
1270+
// Skip non-OVN subnets (e.g., macvlan) that don't create OVN logical switch ports
1271+
if !isOvnSubnet(podNet.Subnet) {
1272+
continue
1273+
}
1274+
12651275
portSecurity := false
12661276
if pod.Annotations[fmt.Sprintf(util.PortSecurityAnnotationTemplate, podNet.ProviderName)] == "true" {
12671277
portSecurity = true

pkg/controller/vip.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ func (c *Controller) handleUpdateVirtualParents(key string) error {
319319
klog.Errorf("failed to get pod nets %v", err)
320320
}
321321
for _, podNet := range podNets {
322+
// Skip non-OVN subnets that don't create OVN logical switch ports
323+
if !isOvnSubnet(podNet.Subnet) {
324+
continue
325+
}
326+
322327
if podNet.Subnet.Name == cachedVip.Spec.Subnet {
323328
portName := ovs.PodNameToPortName(podName, pod.Namespace, podNet.ProviderName)
324329
virtualParents = append(virtualParents, portName)

0 commit comments

Comments
 (0)