diff --git a/scheduler/spread.go b/scheduler/spread.go index 1e4961308..41846382d 100644 --- a/scheduler/spread.go +++ b/scheduler/spread.go @@ -215,7 +215,8 @@ func evenSpreadScoreBoost(pset *propertySet, option *structs.Node) float64 { // Maximum possible penalty when the distribution is even return -1.0 } else if minCount == 0 { - // Maximum possible boost + // Current attribute count is equal to min and both are zero. This means no allocations + // were placed for this attribute value yet. Should get the maximum possible boost. return 1.0 } diff --git a/scheduler/spread_test.go b/scheduler/spread_test.go index bc7532314..9b6d6309d 100644 --- a/scheduler/spread_test.go +++ b/scheduler/spread_test.go @@ -566,4 +566,5 @@ func Test_evenSpreadScoreBoost(t *testing.T) { } boost := evenSpreadScoreBoost(pset, opt) require.False(t, math.IsInf(boost, 1)) + require.Equal(t, 1.0, boost) }