Skip to content

Commit

Permalink
Allow pipeline to be used for review app resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmb committed Jun 27, 2022
1 parent a0b5a45 commit ea58cab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,12 @@ func (a *App) SetScaleParameter(processType string, minProcessCount, maxProcessC
var parameterName string
if a.IsReviewApp() {
parameterName = fmt.Sprintf("/apppack/pipelines/%s/review-apps/pr/%s/scaling", a.Name, *a.ReviewApp)
} else if a.Pipeline {
return fmt.Errorf("scaling/resizing is not supported directly on pipelines")
} else {
parameterName = fmt.Sprintf("/apppack/apps/%s/scaling", a.Name)
}
if a.Pipeline && *maxProcessCount != *minProcessCount {
return fmt.Errorf("auto-scaling is not supported on pipelines")
}
parameterOutput, err := ssmSvc.GetParameter(&ssm.GetParameterInput{
Name: &parameterName,
})
Expand Down
6 changes: 5 additions & 1 deletion cmd/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ var psResizeCmd = &cobra.Command{
checkErr(a.ValidateECSTaskSize(*size))
err = a.ResizeProcess(processType, size.CPU, size.Memory)
checkErr(err)
printSuccess(fmt.Sprintf("resizing %s", processType))
if a.Pipeline {
printSuccess(fmt.Sprintf("set default size for %s processes on review apps", processType))
} else {
printSuccess(fmt.Sprintf("resizing %s", processType))
}
},
}

Expand Down

0 comments on commit ea58cab

Please sign in to comment.