diff --git a/plugins/ipam/static/main.go b/plugins/ipam/static/main.go index d7eaeab11..ed75d1fe2 100644 --- a/plugins/ipam/static/main.go +++ b/plugins/ipam/static/main.go @@ -161,7 +161,7 @@ func LoadIPAMConfig(bytes []byte, envArgs string) (*IPAMConfig, string, error) { ip, subnet, err := net.ParseCIDR(ipstr) if err != nil { - return nil, "", fmt.Errorf("invalid CIDR %s: %s", ipstr, err) + return nil, "", err } addr := Address{ @@ -213,7 +213,7 @@ func LoadIPAMConfig(bytes []byte, envArgs string) (*IPAMConfig, string, error) { for i := range n.IPAM.Addresses { ip, addr, err := net.ParseCIDR(n.IPAM.Addresses[i].AddressStr) if err != nil { - return nil, "", fmt.Errorf("invalid CIDR %s: %s", n.IPAM.Addresses[i].AddressStr, err) + return nil, "", err } n.IPAM.Addresses[i].Address = *addr n.IPAM.Addresses[i].Address.IP = ip diff --git a/plugins/ipam/static/static_test.go b/plugins/ipam/static/static_test.go index cf40c3261..c4dce24e4 100644 --- a/plugins/ipam/static/static_test.go +++ b/plugins/ipam/static/static_test.go @@ -576,7 +576,7 @@ var _ = Describe("static Operations", func() { return cmdAdd(args) }) Expect(err).Should( - MatchError(fmt.Sprintf("invalid CIDR %s: invalid CIDR address: %s", ipStr, ipStr))) + MatchError(fmt.Sprintf("invalid CIDR address: %s", ipStr))) }) }