66 "strconv"
77
88 "github.com/Azure/azure-container-networking/cns"
9- "github.com/Azure/azure-container-networking/cns/restserver"
109 "github.com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha"
1110 "github.com/pkg/errors"
1211)
@@ -17,7 +16,7 @@ import (
1716//nolint:gocritic //ignore hugeparam
1817func createNCRequestFromStaticNCHelper (nc v1alpha.NetworkContainer , primaryIPPrefix netip.Prefix , subnet cns.IPSubnet ) (* cns.CreateNetworkContainerRequest , error ) {
1918 secondaryIPConfigs := map [string ]cns.SecondaryIPConfig {}
20- ipFamilies := map [restserver .IPFamily ]struct {}{}
19+ ipFamilies := map [cns .IPFamily ]struct {}{}
2120
2221 // iterate through all IP addresses in the subnet described by primaryPrefix and
2322 // add them to the request as secondary IPConfigs.
@@ -30,9 +29,9 @@ func createNCRequestFromStaticNCHelper(nc v1alpha.NetworkContainer, primaryIPPre
3029 }
3130 // adds the IPFamily of the primary CIDR to the set
3231 if primaryIPPrefix .Addr ().Is4 () {
33- ipFamilies [restserver .IPv4Family ] = struct {}{}
32+ ipFamilies [cns .IPv4Family ] = struct {}{}
3433 } else {
35- ipFamilies [restserver .IPv6Family ] = struct {}{}
34+ ipFamilies [cns .IPv6Family ] = struct {}{}
3635 }
3736
3837 // Add IPs from CIDR block to the secondary IPConfigs
@@ -55,9 +54,9 @@ func createNCRequestFromStaticNCHelper(nc v1alpha.NetworkContainer, primaryIPPre
5554 }
5655 // adds the IPFamily of the secondary CIDR to the set
5756 if cidrPrefix .Addr ().Is4 () {
58- ipFamilies [restserver .IPv4Family ] = struct {}{}
57+ ipFamilies [cns .IPv4Family ] = struct {}{}
5958 } else {
60- ipFamilies [restserver .IPv6Family ] = struct {}{}
59+ ipFamilies [cns .IPv6Family ] = struct {}{}
6160 }
6261 }
6362 }
0 commit comments