Skip to content

Commit

Permalink
add pgo CLI error message when pgo scale --replica-count is specified…
Browse files Browse the repository at this point in the history
… to be 0 or less
  • Loading branch information
Jeff McCormick committed Aug 19, 2018
1 parent 3a03302 commit 56480d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pgo/cmd/scale.go
Expand Up @@ -59,6 +59,10 @@ var scaleCmd = &cobra.Command{
}
scaleDownCluster(args[0])
} else {
if ReplicaCount < 1 {
fmt.Println("Error: --replica-count is required to be greater than 0, the default is 1 if not specified")
return
}
if util.AskForConfirmation(NoPrompt, "") {
} else {
fmt.Println("Aborting...")
Expand Down Expand Up @@ -90,6 +94,7 @@ func init() {
func scaleCluster(args []string) {

var url string

for _, arg := range args {
log.Debugf(" %s ReplicaCount is %d\n", arg, ReplicaCount)
url = APIServerURL + "/clusters/scale/" + arg + "?replica-count=" + strconv.Itoa(ReplicaCount) + "&resources-config=" + ContainerResources + "&storage-config=" + StorageConfig + "&node-label=" + NodeLabel + "&version=" + msgs.PGO_VERSION + "&ccp-image-tag=" + CCPImageTag + "&service-type=" + ServiceType
Expand Down

0 comments on commit 56480d8

Please sign in to comment.