Skip to content

Commit 2dd97ad

Browse files
committed
rename func names
1 parent 88df751 commit 2dd97ad

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

cns/middlewares/k8sSwiftV2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ func (k *K8sSWIFTv2Middleware) AddRoutes(cidrs []string, gatewayIP string) []cns
239239
}
240240

241241
// Both Linux and Windows CNS gets infravnet and service CIDRs from configuration env
242-
// GetCidrs() returns v4CIDRs(infravnet and service cidrs) as first []string and v6CIDRs(infravnet and service) as second []string
243-
func (k *K8sSWIFTv2Middleware) GetCidrs() ([]string, []string, error) { //nolint
242+
// GetInfravnetAndServiceCidrs() returns v4CIDRs(infravnet and service cidrs) as first []string and v6CIDRs(infravnet and service) as second []string
243+
func (k *K8sSWIFTv2Middleware) GetInfravnetAndServiceCidrs() ([]string, []string, error) { //nolint
244244
v4Cidrs := []string{}
245245
v6Cidrs := []string{}
246246

cns/middlewares/k8sSwiftV2_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ func (k *K8sSWIFTv2Middleware) getInfraRoutes(podIPInfo *cns.PodIpInfo) ([]cns.R
8484
return nil, errors.Wrapf(err, "failed to parse podIPConfig IP address %s", podIPInfo.PodIPConfig.IPAddress)
8585
}
8686

87-
v4IPs, v6IPs, err := k.GetCidrs()
87+
v4IPs, v6IPs, err := k.GetInfravnetAndServiceCidrs()
8888
if err != nil {
89-
return nil, errors.Wrap(err, "failed to get node and service CIDRs")
89+
return nil, errors.Wrap(err, "failed to get infravnet and service CIDRs")
9090
}
9191

9292
v4PodIPs, v6PodIPs, err := k.GetPodCidrs()

cns/middlewares/k8sSwiftV2_windows.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (k *K8sSWIFTv2Middleware) assignSubnetPrefixLengthFields(podIPInfo *cns.Pod
7272
return nil
7373
}
7474

75-
// add default route with gateway IP to podIPInfo for delegatedNIC interface
75+
// add default route with gateway IP to podIPInfo
7676
func (k *K8sSWIFTv2Middleware) addDefaultRoute(podIPInfo *cns.PodIpInfo, gwIP string) {
7777
route := cns.Route{
7878
IPAddress: "0.0.0.0/0",
@@ -232,9 +232,9 @@ func (k *K8sSWIFTv2Middleware) getInfraRoutes(podIPInfo *cns.PodIpInfo) ([]cns.R
232232
}
233233

234234
// TODO: add ipv6 when supported
235-
v4IPs, _, err := k.GetCidrs()
235+
v4IPs, _, err := k.GetInfravnetAndServiceCidrs()
236236
if err != nil {
237-
return nil, errors.Wrap(err, "failed to get CIDRs")
237+
return nil, errors.Wrap(err, "failed to get infravnet and service CIDRs")
238238
}
239239

240240
if ip.Is4() {

0 commit comments

Comments
 (0)