Skip to content

Commit

Permalink
Update scaledobject_types.go
Browse files Browse the repository at this point in the history
Signed-off-by: Shane <[email protected]>
  • Loading branch information
ctccxxd committed Dec 16, 2024
1 parent 9503731 commit 1fc9e5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apis/keda/v1alpha1/scaledobject_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (so *ScaledObject) IsUsingModifiers() bool {
return so.Spec.Advanced != nil && !reflect.DeepEqual(so.Spec.Advanced.ScalingModifiers, ScalingModifiers{})
}

// GetHPAMinReplicas returns MinReplicas based on definition in ScaledObject or default value if not defined
// getHPAMinReplicas returns MinReplicas based on definition in ScaledObject or default value if not defined
func (so *ScaledObject) GetHPAMinReplicas() *int32 {
if so.Spec.MinReplicaCount != nil && *so.Spec.MinReplicaCount > 0 {
return so.Spec.MinReplicaCount
Expand All @@ -246,15 +246,15 @@ func (so *ScaledObject) GetHPAMinReplicas() *int32 {
return &tmp
}

// GetHPAMaxReplicas returns MaxReplicas based on definition in ScaledObject or default value if not defined
// getHPAMaxReplicas returns MaxReplicas based on definition in ScaledObject or default value if not defined
func (so *ScaledObject) GetHPAMaxReplicas() int32 {
if so.Spec.MaxReplicaCount != nil {
return *so.Spec.MaxReplicaCount
}
return defaultHPAMaxReplicas
}

// CheckReplicaCountBoundsAreValid checks that Idle/Min/Max ReplicaCount defined in ScaledObject are correctly specified
// checkReplicaCountBoundsAreValid checks that Idle/Min/Max ReplicaCount defined in ScaledObject are correctly specified
// i.e. that Min is not greater than Max or Idle greater or equal to Min
func CheckReplicaCountBoundsAreValid(scaledObject *ScaledObject) error {
min := int32(0)
Expand Down

0 comments on commit 1fc9e5a

Please sign in to comment.