Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
Max sure scale is set to 0 when autoscaling is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jun 12, 2019
1 parent 12724a4 commit f7c4254
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cli/cmd/scale/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ func (s *Scale) Run(ctx *clicontext.CLIContext) error {

if strings.ContainsRune(scaleStr, '-') {
min, max := kv.Split(scaleStr, "-")
minScale, _ := strconv.Atoi(min)
maxScale, _ := strconv.Atoi(max)
minScale, err := strconv.Atoi(min)
if err != nil {
return err
}
maxScale, err := strconv.Atoi(max)
if err != nil {
return err
}
if service.Spec.AutoscaleConfig.Concurrency == nil {
service.Spec.AutoscaleConfig.Concurrency = &[]int{10}[0]
}
service.Spec.AutoscaleConfig.MinScale = &minScale
service.Spec.AutoscaleConfig.MaxScale = &maxScale
service.Spec.Scale = 0
} else {
scale, err := strconv.Atoi(scaleStr)
if err != nil {
Expand Down

0 comments on commit f7c4254

Please sign in to comment.