Skip to content

Commit 3b37392

Browse files
committed
add default route
1 parent bc7a91b commit 3b37392

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

cns/middlewares/k8sSwiftV2.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ func (k *K8sSWIFTv2Middleware) getIPConfig(ctx context.Context, podInfo cns.PodI
238238
return nil, errors.Wrap(err, "failed to parse mtpnc subnetAddressSpace prefix")
239239
}
240240
podIPInfos = append(podIPInfos, podIPInfo)
241-
// for windows scenario, it is required to add default route with gatewayIP from CNS
242-
k.addDefaultRoute(&podIPInfo)
243-
logger.Printf("default route windows are %v", podIPInfo.Routes)
241+
// // for windows scenario, it is required to add default route with gatewayIP from CNS
242+
// k.addDefaultRoute(&podIPInfo)
243+
// logger.Printf("default route windows are %v", podIPInfo.Routes)
244244
}
245245
}
246246
}
@@ -305,6 +305,7 @@ func (k *K8sSWIFTv2Middleware) SetInfraRoutes(podIPInfo *cns.PodIpInfo) ([]cns.R
305305
routes = append(routes, k.addRoutes(podCIDRsV4, "10.229.0.1")...)
306306
routes = append(routes, k.addRoutes(serviceCIDRsV4, "10.0.0.1")...)
307307
routes = append(routes, k.addRoutes(infraVNETCIDRsv4, "10.225.0.1")...)
308+
routes = append(routes, k.addRoutes("0.0.0.0/0", "0.0.0.0")...)
308309
} else {
309310
routes = append(routes, k.addRoutes(podCIDRv6, overlayGatewayV6)...)
310311
routes = append(routes, k.addRoutes(serviceCIDRsV6, overlayGatewayV6)...)

cns/middlewares/k8sSwiftV2_windows.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ func (k *K8sSWIFTv2Middleware) assignSubnetPrefixLengthFields(podIPInfo *cns.Pod
5959
}
6060

6161
// add default route with gateway IP to podIPInfo
62-
func (k *K8sSWIFTv2Middleware) addDefaultRoute(podIPInfo *cns.PodIpInfo) {
63-
route := cns.Route{
64-
IPAddress: "0.0.0.0/0",
65-
GatewayIPAddress: "10.242.0.2",
66-
}
67-
podIPInfo.Routes = append(podIPInfo.Routes, route)
68-
}
62+
// func (k *K8sSWIFTv2Middleware) addDefaultRoute(podIPInfo *cns.PodIpInfo) {
63+
// route := cns.Route{
64+
// IPAddress: "0.0.0.0/0",
65+
// GatewayIPAddress: "10.242.0.2",
66+
// }
67+
// podIPInfo.Routes = append(podIPInfo.Routes, route)
68+
// }

0 commit comments

Comments
 (0)