mirror of https://github.com/k3s-io/k3s
Refactor err checking
parent
9d30833e53
commit
2472d34bf0
|
@ -280,9 +280,11 @@ func parseExcludedCIDRs(excludeCIDRs []string) []*net.IPNet {
|
||||||
var cidrExclusions []*net.IPNet
|
var cidrExclusions []*net.IPNet
|
||||||
for _, excludedCIDR := range excludeCIDRs {
|
for _, excludedCIDR := range excludeCIDRs {
|
||||||
_, n, err := net.ParseCIDR(excludedCIDR)
|
_, n, err := net.ParseCIDR(excludedCIDR)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
cidrExclusions = append(cidrExclusions, n)
|
klog.Errorf("Error parsing exclude CIDR %q, err: %v", excludedCIDR, err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
cidrExclusions = append(cidrExclusions, n)
|
||||||
}
|
}
|
||||||
return cidrExclusions
|
return cidrExclusions
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue