From 2472d34bf091d51fff18246fbf451ebcee9ec4f9 Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Thu, 25 Apr 2019 10:18:48 -0700 Subject: [PATCH] Refactor err checking --- pkg/proxy/ipvs/proxier.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index cccca5ab1b..02452930bb 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -280,9 +280,11 @@ func parseExcludedCIDRs(excludeCIDRs []string) []*net.IPNet { var cidrExclusions []*net.IPNet for _, excludedCIDR := range excludeCIDRs { _, n, err := net.ParseCIDR(excludedCIDR) - if err == nil { - cidrExclusions = append(cidrExclusions, n) + if err != nil { + klog.Errorf("Error parsing exclude CIDR %q, err: %v", excludedCIDR, err) + continue } + cidrExclusions = append(cidrExclusions, n) } return cidrExclusions }