Skip to content

Commit

Permalink
Update autoscaling policy target validation tag
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlycoconuts committed Jul 16, 2024
1 parent d251e58 commit ba7452e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/turing/models/autoscaling_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ type AutoscalingPolicy struct {
// Target is the target value of the metric that should be reached to add a new replica.
// It is expected that the autoscaling target is an absolute value for concurrency / rps
// while it is a % value (of the requested value) for cpu / memory.
Target string `json:"target" validate:"required,number"`
// The 'numeric' type is used to allow decimals in strings to be set as the target value,
// e.g. "8.88". See https://github.com/go-playground/validator/issues/940 for more details.
Target string `json:"target" validate:"required,numeric"`
}

func (a AutoscalingPolicy) Value() (driver.Value, error) {
Expand Down

0 comments on commit ba7452e

Please sign in to comment.