-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
agent: memif and vcl fixes #662
Conversation
9cc9a5c
to
1a497c8
Compare
1a497c8
to
9b4fd78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR,
As this codepath is getting a bit complex, it might be worth doing a bit of extra refactoring along the way, so that
pblswIfIndex, pblIsL3 := podSpec.GetParamsForIfType(podSpec.PortFilteredIfType)
swIfIndex, isL3 = podSpec.GetParamsForIfType(podSpec.DefaultIfType)
if podSpec.EnableVCL {
err = s.SetupPuntRoutes(podSpec, stack, podSpec.TunTapSwIfIndex)
err = s.AddRouteNetworkVRFToPodVRF(podSpec, stack)
} else if pblswIfIndex != types.InvalidID {
err = s.AddRoutePodVRFtoPodInterface()
err = s.AddRouteNetworkVRFToPodVRF(podSpec, stack)
} else {
err = s.AddRouteNetworkVRFtoPodInterface()
}
And remove the logging from the AddVppInterface
function to have it only in the AddRoute...To...()
functions. What do you think ?
if err != nil { | ||
goto err | ||
} | ||
} else { | ||
s.log.Warn("No default if type for pod") | ||
} | ||
if pblswIfIndex != types.InvalidID { | ||
err = s.CreateVRFRoutesToPod(podSpec, stack) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe CreateVRFRoutesToPod
-> AddRouteNetworkVRFToPodVRF
swIfIndex, isL3 = podSpec.GetParamsForIfType(podSpec.DefaultIfType) | ||
if swIfIndex != types.InvalidID { | ||
s.log.Infof("pod(add) Default routes to swIfIndex=%d isL3=%t", swIfIndex, isL3) | ||
err = s.RoutePodInterface(podSpec, stack, swIfIndex, isL3) | ||
err = s.RoutePodInterface(podSpec, stack, swIfIndex, isL3, pblswIfIndex != types.InvalidID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a inPodVRF
it might be better to have two functions :
AddRouteNetworkVRFtoPodInterface()
AddRoutePodVRFtoPodInterface()
@@ -210,16 +210,23 @@ func (s *Server) AddVppInterface(podSpec *storage.LocalPodSpec, doHostSideConf b | |||
goto err | |||
} | |||
} else { | |||
pblswIfIndex, _ := podSpec.GetParamsForIfType(podSpec.PortFilteredIfType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If might be worth adding a
pblswIfIndex, pblIsL3 := podSpec.GetParamsForIfType(podSpec.PortFilteredIfType)
swIfIndex, isL3 = podSpec.GetParamsForIfType(podSpec.DefaultIfType)
at the beginning of the /* Routes */
section
Actually with the release proximity and as this fixes memif/VCL, let's maybe merge this PR and keep the refactoring for a later PR. |
No description provided.