fix sed replace that overreached.

This commit is contained in:
Raúl Kripalani 2021-01-20 10:41:55 +00:00
parent 31d951f370
commit 07b4c6d751
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ func TestAdaptivePolicy(t *testing.T) {
next = p.Evaluate(UtilizationSystem, limit64MiB/2) next = p.Evaluate(UtilizationSystem, limit64MiB/2)
require.EqualValues(t, 3*(limit64MiB/4), next) require.EqualValues(t, 3*(limit64MiB/4), next)
// at limit64MiB. // at limit.
next = p.Evaluate(UtilizationSystem, limit64MiB) next = p.Evaluate(UtilizationSystem, limit64MiB)
require.EqualValues(t, limit64MiB, next) require.EqualValues(t, limit64MiB, next)
} }

View File

@ -29,7 +29,7 @@ type watermarkPolicy struct {
var _ Policy = (*watermarkPolicy)(nil) var _ Policy = (*watermarkPolicy)(nil)
func (w *watermarkPolicy) Evaluate(_ UtilizationType, used uint64) (next uint64) { func (w *watermarkPolicy) Evaluate(_ UtilizationType, used uint64) (next uint64) {
Logger.Debugf("watermark policy: evaluating; utilization: %d/%d (used/limit64MiB)", used, w.limit) Logger.Debugf("watermark policy: evaluating; utilization: %d/%d (used/limit)", used, w.limit)
var i int var i int
for ; i < len(w.thresholds); i++ { for ; i < len(w.thresholds); i++ {
t := w.thresholds[i] t := w.thresholds[i]