Skip to content

Commit

Permalink
fix: err should not return
Browse files Browse the repository at this point in the history
Signed-off-by: bobz965 <[email protected]>
  • Loading branch information
bobz965 committed Oct 12, 2024
1 parent 2427614 commit cd0883b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/ovs/ovs-vsctl_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func SetHtbQosQueueRecord(podName, podNamespace, iface string, maxRateBPS int, q
if queueUID, ok := queueIfaceUIDMap[iface]; ok {
if err := ovsSet("queue", queueUID, queueCommandValues...); err != nil {
klog.Error(err)
return queueUID, err
return "", err
}
} else {
queueCommandValues = append(queueCommandValues, fmt.Sprintf("external-ids:iface-id=%s", iface))
Expand All @@ -165,7 +165,7 @@ func SetHtbQosQueueRecord(podName, podNamespace, iface string, maxRateBPS int, q
var queueID string
if queueID, err = ovsCreate("queue", queueCommandValues...); err != nil {
klog.Error(err)
return queueUID, err
return "", err
}
queueIfaceUIDMap[iface] = queueID
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/ovs/ovs-vsctl_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ func (suite *OvnClientTestSuite) testDeleteNetemQosByID() {
t := suite.T()
t.Parallel()
err := deleteNetemQosByID("qosID", "eth0", "podName", "podNS")
// no ovs-vsctl command
require.Error(t, err)
require.Nil(t, err)
}

func (suite *OvnClientTestSuite) testIsUserspaceDataPath() {
Expand All @@ -104,8 +103,7 @@ func (suite *OvnClientTestSuite) testCheckAndUpdateHtbQos() {
t.Parallel()
// get a new id
err := CheckAndUpdateHtbQos("podName", "podNS", "eth0", nil)
// no ovs-vsctl command
require.Error(t, err)
require.Nil(t, err)

// get a exist id
queueIfaceUIDMap := make(map[string]string)
Expand Down

0 comments on commit cd0883b

Please sign in to comment.