Skip to content

Commit

Permalink
config: disable label check by default (#1568)
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <nolouch@gmail.com>
  • Loading branch information
nolouch authored and rleungx committed Jun 10, 2019
1 parent ebf6cf2 commit 8051f7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions server/api/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ func (s *testStoreSuite) TestStoreLabel(c *C) {
c.Assert(err, IsNil)
c.Assert(info.Store.Labels, HasLen, 0)

// Test merge.
// enable label match check.
labelCheck := map[string]string{"strictly-match-label": "true"}
lc, _ := json.Marshal(labelCheck)
err = postJSON(s.urlPrefix+"/config", lc)
c.Assert(err, IsNil)
// Test set.
labels := map[string]string{"zone": "cn", "host": "local"}
b, err := json.Marshal(labels)
Expand All @@ -169,8 +175,8 @@ func (s *testStoreSuite) TestStoreLabel(c *C) {

// Test merge.
// disable label match check.
labelCheck := map[string]string{"strictly-match-label": "false"}
lc, _ := json.Marshal(labelCheck)
labelCheck = map[string]string{"strictly-match-label": "false"}
lc, _ = json.Marshal(labelCheck)
err = postJSON(s.urlPrefix+"/config", lc)
c.Assert(err, IsNil)

Expand Down
2 changes: 1 addition & 1 deletion server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const (
defaultLeaderPriorityCheckInterval = time.Minute

defaultUseRegionStorage = true
defaultStrictlyMatchLabel = true
defaultStrictlyMatchLabel = false
)

func adjustString(v *string, defValue string) {
Expand Down

0 comments on commit 8051f7b

Please sign in to comment.