Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
Signed-off-by: bobz965 <[email protected]>
  • Loading branch information
bobz965 committed Nov 30, 2023
1 parent 0d7a854 commit 1ceb9d3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions mocks/pkg/ovs/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/ovs/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type GatewayChassis interface {
type BFD interface {
CreateBFD(lrpName, dstIP string, minRx, minTx, detectMult int) (*ovnnb.BFD, error)
DeleteBFD(lrpName, dstIP string) error
ListBFD(lrpName, dstIP string) ([]ovnnb.BFD, error)
ListBFDs(lrpName, dstIP string) ([]ovnnb.BFD, error)
ListDownBFDs(dstIP string) ([]ovnnb.BFD, error)
ListUpBFDs(dstIP string) ([]ovnnb.BFD, error)
UpdateBFD(bfd *ovnnb.BFD, fields ...interface{}) error
Expand Down
10 changes: 5 additions & 5 deletions pkg/ovs/ovn-nb-bfd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/ovn-org/libovsdb/model"
)

func (c *OVNNbClient) ListBFD(lrpName, dstIP string) ([]ovnnb.BFD, error) {
func (c *OVNNbClient) ListBFDs(lrpName, dstIP string) ([]ovnnb.BFD, error) {
ctx, cancel := context.WithTimeout(context.Background(), c.Timeout)
defer cancel()

Expand Down Expand Up @@ -69,7 +69,7 @@ func (c *OVNNbClient) ListUpBFDs(dstIP string) ([]ovnnb.BFD, error) {
}

func (c *OVNNbClient) CreateBFD(lrpName, dstIP string, minRx, minTx, detectMult int) (*ovnnb.BFD, error) {
bfdList, err := c.ListBFD(lrpName, dstIP)
bfdList, err := c.ListBFDs(lrpName, dstIP)
if err != nil {
klog.Error(err)
return nil, err
Expand Down Expand Up @@ -97,7 +97,7 @@ func (c *OVNNbClient) CreateBFD(lrpName, dstIP string, minRx, minTx, detectMult
return nil, err
}

if bfdList, err = c.ListBFD(lrpName, dstIP); err != nil {
if bfdList, err = c.ListBFDs(lrpName, dstIP); err != nil {
return nil, err
}
if len(bfdList) == 0 {
Expand All @@ -123,7 +123,7 @@ func (c *OVNNbClient) UpdateBFD(bfd *ovnnb.BFD, fields ...interface{}) error {
}

func (c *OVNNbClient) DeleteBFD(lrpName, dstIP string) error {
bfdList, err := c.ListBFD(lrpName, dstIP)
bfdList, err := c.ListBFDs(lrpName, dstIP)
if err != nil {
klog.Error(err)
return err
Expand Down Expand Up @@ -167,7 +167,7 @@ func (c *OVNNbClient) MonitorBFD() {
}

func (c *OVNNbClient) isLrpBfdUp(lrpName, dstIP string) (bool, error) {
bfdList, err := c.ListBFD(lrpName, dstIP)
bfdList, err := c.ListBFDs(lrpName, dstIP)
if err != nil {
klog.Errorf("failed to list bfd for lrp %s, %v", lrpName, err)
return false, err
Expand Down
12 changes: 6 additions & 6 deletions pkg/ovs/ovn-nb-bfd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ func (suite *OvnClientTestSuite) testListBFD() {
require.NoError(t, err)
require.NotNil(t, bfd2)

bfdList, err := ovnClient.ListBFD(lrpName, dstIP1)
bfdList, err := ovnClient.ListBFDs(lrpName, dstIP1)
require.NoError(t, err)
require.Len(t, bfdList, 1)
require.Equal(t, bfd1.UUID, bfdList[0].UUID)

bfdList, err = ovnClient.ListBFD(lrpName, dstIP2)
bfdList, err = ovnClient.ListBFDs(lrpName, dstIP2)
require.NoError(t, err)
require.Len(t, bfdList, 1)
require.Equal(t, bfd2.UUID, bfdList[0].UUID)

bfdList, err = ovnClient.ListBFD(lrpName, "")
bfdList, err = ovnClient.ListBFDs(lrpName, "")
require.NoError(t, err)
require.Len(t, bfdList, 2)
uuids := strset.NewWithSize(len(bfdList))
Expand Down Expand Up @@ -97,11 +97,11 @@ func (suite *OvnClientTestSuite) testDeleteBFD() {
err = ovnClient.DeleteBFD(lrpName, dstIP1)
require.NoError(t, err)

bfdList, err := ovnClient.ListBFD(lrpName, dstIP1)
bfdList, err := ovnClient.ListBFDs(lrpName, dstIP1)
require.NoError(t, err)
require.Len(t, bfdList, 0)

bfdList, err = ovnClient.ListBFD(lrpName, dstIP2)
bfdList, err = ovnClient.ListBFDs(lrpName, dstIP2)
require.NoError(t, err)
require.Len(t, bfdList, 1)
require.Equal(t, bfd2.UUID, bfdList[0].UUID)
Expand All @@ -111,7 +111,7 @@ func (suite *OvnClientTestSuite) testDeleteBFD() {
err = ovnClient.DeleteBFD(lrpName, "")
require.NoError(t, err)

bfdList, err := ovnClient.ListBFD(lrpName, "")
bfdList, err := ovnClient.ListBFDs(lrpName, "")
require.NoError(t, err)
require.Len(t, bfdList, 0)
})
Expand Down

0 comments on commit 1ceb9d3

Please sign in to comment.