Skip to content

Commit

Permalink
fix: use scale.max if it is set (#179)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <whynowy@gmail.com>

Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy committed Sep 20, 2022
1 parent ce404fa commit c44f733
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apis/numaflow/v1alpha1/vertex_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ func (s Scale) GetMinReplicas() int32 {
}

func (s Scale) GetMaxReplicas() int32 {
if x := s.Max; x == nil || *x > DefaultMaxReplicas {
if x := s.Max; x == nil {
return DefaultMaxReplicas
} else {
return *x
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/numaflow/v1alpha1/vertex_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,6 @@ func Test_Scale_Parameters(t *testing.T) {
assert.Equal(t, int(tbu), s.GetTargetBufferUsage())
assert.Equal(t, int(tps), s.GetTargetProcessingSeconds())
assert.Equal(t, int(zrss), s.GetZeroReplicaSleepSeconds())
s.Max = pointer.Int32(500)
assert.Equal(t, int32(500), s.GetMaxReplicas())
}

0 comments on commit c44f733

Please sign in to comment.