Skip to content

Conversation

paulyufan2
Copy link
Contributor

…c scenario

Reason for Change:

This PR is to add the default route only when skipdefaultroutes flag set to false in dualnic scenario

Issue Fixed:

Requirements:

Notes:

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines +164 to +165
func (m *Multitenancy) addDefaultRouteToGateway(gwStr string, epInfo *network.EndpointInfo, result *network.InterfaceInfo) error {
gw := net.ParseIP(gwStr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (m *Multitenancy) addDefaultRouteToGateway(gwStr string, epInfo *network.EndpointInfo, result *network.InterfaceInfo) error {
gw := net.ParseIP(gwStr)
func (m *Multitenancy) addDefaultRoute(gwStr string, epInfo *network.EndpointInfo, result *network.InterfaceInfo) error {
gw := net.ParseIP(gwStr)

result.Routes = append(result.Routes, network.RouteInfo{Dst: dstIP, Gw: gwIP})
// only set default route when skipDefaultRoutes is false to avoid duplicated default routes given to HNS
if !epInfo.SkipDefaultRoutes {
if err := m.addDefaultRouteToGateway(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if err := m.addDefaultRouteToGateway(
if err := m.addDefaultRoute(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants