Skip to content

Commit 2472d34

Browse files
tedyuyutedz
authored andcommitted
Refactor err checking
1 parent 9d30833 commit 2472d34

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/proxy/ipvs/proxier.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,11 @@ func parseExcludedCIDRs(excludeCIDRs []string) []*net.IPNet {
280280
var cidrExclusions []*net.IPNet
281281
for _, excludedCIDR := range excludeCIDRs {
282282
_, n, err := net.ParseCIDR(excludedCIDR)
283-
if err == nil {
284-
cidrExclusions = append(cidrExclusions, n)
283+
if err != nil {
284+
klog.Errorf("Error parsing exclude CIDR %q, err: %v", excludedCIDR, err)
285+
continue
285286
}
287+
cidrExclusions = append(cidrExclusions, n)
286288
}
287289
return cidrExclusions
288290
}

0 commit comments

Comments
 (0)