This is an automated email from the ASF dual-hosted git repository.

littlecui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new 1e4dd8a5 [fix]typo load balance policy name (#1333)
1e4dd8a5 is described below

commit 1e4dd8a52097f02bb770621a14c3a4c2beda741a
Author: little-cui <[email protected]>
AuthorDate: Sat Aug 20 16:44:54 2022 +0800

    [fix]typo load balance policy name (#1333)
---
 server/ext/policy/buitin.go               | 2 +-
 server/resource/gov/gov_resource_test.go  | 4 ++--
 server/service/grc/kie/kie_distributor.go | 2 +-
 server/service/grc/mock/mock.go           | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/server/ext/policy/buitin.go b/server/ext/policy/buitin.go
index f9bda76a..90e2e42e 100644
--- a/server/ext/policy/buitin.go
+++ b/server/ext/policy/buitin.go
@@ -23,7 +23,7 @@ import (
 )
 
 func init() {
-       grc.RegisterPolicySchema("loadbalancer", &spec.Schema{
+       grc.RegisterPolicySchema("loadbalance", &spec.Schema{
                SchemaProps: spec.SchemaProps{
                        Type:     []string{"object"},
                        Required: []string{"rule"},
diff --git a/server/resource/gov/gov_resource_test.go 
b/server/resource/gov/gov_resource_test.go
index aab89cd3..31cbe5b8 100644
--- a/server/resource/gov/gov_resource_test.go
+++ b/server/resource/gov/gov_resource_test.go
@@ -66,7 +66,7 @@ func TestGovernance_Create(t *testing.T) {
                        Spec: map[string]interface{}{
                                "rule": "rr",
                        }})
-               r, _ := http.NewRequest(http.MethodPost, 
"/v1/default/gov/loadbalancer", bytes.NewBuffer(b))
+               r, _ := http.NewRequest(http.MethodPost, 
"/v1/default/gov/loadbalance", bytes.NewBuffer(b))
                w := httptest.NewRecorder()
                rest.GetRouter().ServeHTTP(w, r)
                assert.Equal(t, http.StatusOK, w.Code)
@@ -75,7 +75,7 @@ func TestGovernance_Create(t *testing.T) {
                b, _ := json.Marshal(&gov.Policy{
                        GovernancePolicy: &gov.GovernancePolicy{Name: "test"},
                        Spec:             map[string]interface{}{}})
-               r, _ := http.NewRequest(http.MethodPost, 
"/v1/default/gov/loadbalancer", bytes.NewBuffer(b))
+               r, _ := http.NewRequest(http.MethodPost, 
"/v1/default/gov/loadbalance", bytes.NewBuffer(b))
                w := httptest.NewRecorder()
                rest.GetRouter().ServeHTTP(w, r)
                assert.Equal(t, http.StatusBadRequest, w.Code)
diff --git a/server/service/grc/kie/kie_distributor.go 
b/server/service/grc/kie/kie_distributor.go
index c0be5fbd..1ba1fab9 100644
--- a/server/service/grc/kie/kie_distributor.go
+++ b/server/service/grc/kie/kie_distributor.go
@@ -49,7 +49,7 @@ var PolicyNames = []string{
        "instanceIsolation",
        "faultInjection",
        "bulkhead",
-       "loadbalancer",
+       "loadbalance",
 }
 
 func (d *Distributor) Create(ctx context.Context, kind, project string, p 
*gov.Policy) ([]byte, error) {
diff --git a/server/service/grc/mock/mock.go b/server/service/grc/mock/mock.go
index 522c7a70..4a719058 100644
--- a/server/service/grc/mock/mock.go
+++ b/server/service/grc/mock/mock.go
@@ -44,7 +44,7 @@ var PolicyNames = []string{
        "instanceIsolation",
        "faultInjection",
        "bulkhead",
-       "loadbalancer",
+       "loadbalance",
 }
 
 func (d *Distributor) Create(ctx context.Context, kind, project string, p 
*gov.Policy) ([]byte, error) {

Reply via email to