Skip to content

Commit

Permalink
Add Layer 2 forwarding for subnet ports again
Browse files Browse the repository at this point in the history
This feature has been added previously, but fallen victim to a
refactoring that removed it. We now add it back again.

Signed-off-by: Tobias Kantusch <[email protected]>
  • Loading branch information
sirkrypt0 authored and zhangzujian committed Oct 24, 2023
1 parent 352b161 commit 56dbd1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,14 @@ func (c *Controller) reconcileAllocateSubnets(cachedPod, pod *v1.Pod, needAlloca
return nil, err
}

if pod.Annotations[fmt.Sprintf(util.Layer2ForwardAnnotationTemplate, podNet.ProviderName)] == "true" {
if err := c.OVNNbClient.EnablePortLayer2forward(portName); err != nil {
c.recorder.Eventf(pod, v1.EventTypeWarning, "SetOVNPortL2ForwardFailed", err.Error())
klog.Errorf("%v", err)
return nil, err
}
}

if portSecurity {
sgNames := strings.Split(securityGroupAnnotation, ",")
for _, sgName := range sgNames {
Expand Down

0 comments on commit 56dbd1b

Please sign in to comment.