[#31] placement: Fix confused selectors and replicas

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-18 20:34:46 +03:00 committed by Alex Vanin
parent f7c685f682
commit 73ee5105ff
2 changed files with 31 additions and 31 deletions

View file

@ -77,14 +77,14 @@ func NewTraverser(opts ...Option) (*Traverser, error) {
return nil, errors.Wrap(err, "could not build placement")
}
ss := cfg.policy.GetSelectors()
rem := make([]int, 0, len(ss))
rs := cfg.policy.GetReplicas()
rem := make([]int, 0, len(rs))
for i := range ss {
for i := range rs {
cnt := cfg.rem
if cnt == 0 {
cnt = int(ss[i].GetCount())
cnt = int(rs[i].GetCount())
}
rem = append(rem, cnt)