Skip to content

Commit

Permalink
fix: ci error
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Aug 28, 2022
1 parent c80cd6b commit 04042a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions pkg/admin/router/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ func ListNodes(c *gin.Context) {
}
var data []string
for _, cluster := range clusters {
groups, err := service.ListGroups(c, cluster)
groups, err := service.ListGroups(c, tenantName, cluster)
if err != nil {
_ = c.Error(err)
continue
}
for _, group := range groups {
temp, err := service.ListNodes(c, cluster, group)
temp, err := service.ListNodes(c, tenantName, cluster, group)
if err != nil {
_ = c.Error(err)
continue
Expand All @@ -86,13 +86,13 @@ func GetNode(c *gin.Context) {
}
var data *config.Node
for _, cluster := range clusters {
groups, err := service.ListGroups(c, cluster)
groups, err := service.ListGroups(c, tenant, cluster)
if err != nil {
_ = c.Error(err)
continue
}
for _, group := range groups {
data, err = service.GetNode(c, cluster, group, node)
data, err = service.GetNode(c, tenant, cluster, group, node)
if err != nil {
_ = c.Error(err)
continue
Expand Down
12 changes: 6 additions & 6 deletions pkg/config/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestRegister(t *testing.T) {
mockStore := testdata.NewMockStoreOperate(ctrl)
mockStore.EXPECT().Name().Times(2).Return("nacos")
type args struct {
s config.StoreOperate
s config.StoreOperator
}
tests := []struct {
name string
Expand All @@ -71,7 +71,7 @@ func TestRegister(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
config.Regis(tt.args.s)
config.Register(tt.args.s)
})
}
}
Expand All @@ -83,13 +83,13 @@ func Test_api(t *testing.T) {
mockEtcdStore := testdata.NewMockStoreOperate(ctrl)
mockFileStore.EXPECT().Name().Times(2).Return("file")
mockEtcdStore.EXPECT().Name().Times(2).Return("etcd")
config.Regis(mockFileStore)
config.Regis(mockEtcdStore)
config.Register(mockFileStore)
config.Register(mockEtcdStore)

mockFileStore2 := testdata.NewMockStoreOperate(ctrl)
mockFileStore2.EXPECT().Name().AnyTimes().Return("file")
assert.Panics(t, func() {
config.Regis(mockFileStore2)
config.Register(mockFileStore2)
}, "StoreOperate=[file] already exist")
}

Expand All @@ -107,7 +107,7 @@ func Test_Init(t *testing.T) {
err := config.Init(options, "fake")
assert.Error(t, err)

config.Regis(mockFileStore)
config.Register(mockFileStore)
err = config.Init(options, "fake")
assert.NoError(t, err)

Expand Down

0 comments on commit 04042a2

Please sign in to comment.