Skip to content

Commit

Permalink
Add Layer 2 forwarding for subnet ports again (#3300)
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 <git@kantusch.dev>
  • Loading branch information
sirkrypt0 authored and oilbeater committed Oct 31, 2023
1 parent 31e77fb commit 5da7496
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 5da7496

Please sign in to comment.