@@ -66,13 +66,13 @@ func (k *K8sSWIFTv2Middleware) setRoutes(podIPInfo *cns.PodIpInfo) error {
6666 }
6767
6868 if ip .Is4 () {
69- routes = append (routes , addRoutes (podCIDRsV4 , overlayGatewayv4 )... )
70- routes = append (routes , addRoutes (serviceCIDRsV4 , overlayGatewayv4 )... )
71- routes = append (routes , addRoutes (infraVNETCIDRsv4 , overlayGatewayv4 )... )
69+ routes = append (routes , k . AddRoutes (podCIDRsV4 , overlayGatewayv4 )... )
70+ routes = append (routes , k . AddRoutes (serviceCIDRsV4 , overlayGatewayv4 )... )
71+ routes = append (routes , k . AddRoutes (infraVNETCIDRsv4 , overlayGatewayv4 )... )
7272 } else {
73- routes = append (routes , addRoutes (podCIDRv6 , overlayGatewayV6 )... )
74- routes = append (routes , addRoutes (serviceCIDRsV6 , overlayGatewayV6 )... )
75- routes = append (routes , addRoutes (infraVNETCIDRsv6 , overlayGatewayV6 )... )
73+ routes = append (routes , k . AddRoutes (podCIDRv6 , overlayGatewayV6 )... )
74+ routes = append (routes , k . AddRoutes (serviceCIDRsV6 , overlayGatewayV6 )... )
75+ routes = append (routes , k . AddRoutes (infraVNETCIDRsv6 , overlayGatewayV6 )... )
7676 }
7777 podIPInfo .SkipDefaultRoutes = true
7878
@@ -86,17 +86,6 @@ func (k *K8sSWIFTv2Middleware) setRoutes(podIPInfo *cns.PodIpInfo) error {
8686 return nil
8787}
8888
89- func addRoutes (cidrs []string , gatewayIP string ) []cns.Route {
90- routes := make ([]cns.Route , len (cidrs ))
91- for i , cidr := range cidrs {
92- routes [i ] = cns.Route {
93- IPAddress : cidr ,
94- GatewayIPAddress : gatewayIP ,
95- }
96- }
97- return routes
98- }
99-
10089// assignSubnetPrefixLengthFields is a no-op for linux swiftv2 as the default prefix-length is sufficient
10190func (k * K8sSWIFTv2Middleware ) assignSubnetPrefixLengthFields (_ * cns.PodIpInfo , _ v1alpha1.InterfaceInfo , _ string ) error {
10291 return nil
0 commit comments