diff --git a/pkg/controller/gc.go b/pkg/controller/gc.go index 01d48511198..4e0caeb6f63 100644 --- a/pkg/controller/gc.go +++ b/pkg/controller/gc.go @@ -658,7 +658,7 @@ func (c *Controller) gcAddressSet() error { } if err = c.OVNNbClient.DeleteAddressSet(asList...); err != nil { - klog.Errorf("failed to delete address set %v,%v", asList, err) + klog.Errorf("failed to delete address set %v: %v", asList, err) return err } diff --git a/pkg/daemon/handler.go b/pkg/daemon/handler.go index 68b956ece9c..86c7d0d1458 100644 --- a/pkg/daemon/handler.go +++ b/pkg/daemon/handler.go @@ -456,7 +456,7 @@ func (csh cniServerHandler) handleDel(req *restful.Request, resp *restful.Respon var vmName string // If the Pod was found, process its annotations and labels. - if err == nil { + if pod != nil { if pod.Annotations != nil && (util.IsOvnProvider(podRequest.Provider) || podRequest.CniType == util.CniTypeName) { subnet := pod.Annotations[fmt.Sprintf(util.LogicalSwitchAnnotationTemplate, podRequest.Provider)] if subnet != "" { diff --git a/pkg/util/validator.go b/pkg/util/validator.go index 942eb750ffe..fd4577ca766 100644 --- a/pkg/util/validator.go +++ b/pkg/util/validator.go @@ -356,7 +356,7 @@ func ValidateNetworkBroadcast(cidr, ip string) error { } _, network, _ := net.ParseCIDR(cidrBlock) if AddressCount(network) == 1 { - return fmt.Errorf("subnet %s is configured with /32 netmask", cidrBlock) + return fmt.Errorf("subnet %s is configured with /32 or /128 netmask", cidrBlock) } ipStr := IPToString(ipAddr) diff --git a/pkg/util/validator_test.go b/pkg/util/validator_test.go index 956918060c6..e5625e76628 100644 --- a/pkg/util/validator_test.go +++ b/pkg/util/validator_test.go @@ -841,7 +841,7 @@ func TestValidateSubnet(t *testing.T) { }, Status: kubeovnv1.SubnetStatus{}, }, - err: "validate gateway 10.16.0.0 for cidr 10.16.0.0/32 failed: subnet 10.16.0.0/32 is configured with /32 netmask", + err: "validate gateway 10.16.0.0 for cidr 10.16.0.0/32 failed: subnet 10.16.0.0/32 is configured with /32 or /128 netmask", }, }