Skip to content

Commit

Permalink
EVEREST-1404 update sharding validation (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
oksana-grishchenko authored Sep 5, 2024
1 parent 1c9525d commit 412e760
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const (
maxNameLength = 22
timeoutS3AccessSec = 2
minShardsNum = 1
minConfigServersNum = 3
minConfigServersNum = 1
)

var (
Expand Down Expand Up @@ -112,7 +112,7 @@ var (
errInsufficientPermissions = errors.New("insufficient permissions for performing the operation")
errShardingIsNotSupported = errors.New("sharding is not supported")
errInsufficientShardsNumber = errors.New("shards number should be greater than 0")
errInsufficientCfgSrvNumber = errors.New("sharding: minimum config servers number is 3")
errInsufficientCfgSrvNumber = errors.New("sharding: minimum config servers number is 1")
errEvenServersNumber = errors.New("sharding: config servers number should be odd")
errDisableShardingNotSupported = errors.New("sharding: disable sharding is not supported")
errChangeShardsNumNotSupported = errors.New("sharding: change shards number is not supported")
Expand Down
2 changes: 1 addition & 1 deletion api/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ func TestValidateSharding(t *testing.T) {
},
{
desc: "insufficient configservers",
updated: []byte(`{"spec": {"engine": {"type": "psmdb"}, "sharding": {"enabled": true, "shards": 1,"configServer": {"replicas": 1}}}}`),
updated: []byte(`{"spec": {"engine": {"type": "psmdb"}, "sharding": {"enabled": true, "shards": 1,"configServer": {"replicas": 0}}}}`),
expected: errInsufficientCfgSrvNumber,
},
{
Expand Down

0 comments on commit 412e760

Please sign in to comment.