Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: err is always nil #4857

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/controller/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}

Expand Down
Loading