Skip to content

Commit

Permalink
Fix rollback and tests that check help text
Browse files Browse the repository at this point in the history
Signed-off-by: João Pereira <joaod@vmware.com>
  • Loading branch information
joaopapereira committed Aug 7, 2024
1 parent a1ba45e commit 07fd1bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion command/v7/rollback_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (cmd RollbackCommand) Execute(args []string) error {

func (cmd RollbackCommand) ValidateFlags() error {
switch {
case cmd.MaxInFlight < 1:
case cmd.MaxInFlight < -1 || cmd.MaxInFlight == 0:
return translatableerror.IncorrectUsageError{Message: "--max-in-flight must be greater than or equal to 1"}
}

Expand Down
2 changes: 1 addition & 1 deletion integration/v7/isolated/restage_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var _ = Describe("restage command", func() {
Eventually(session).Should(Say("ALIAS:"))
Eventually(session).Should(Say("rg"))
Eventually(session).Should(Say("OPTIONS:"))
Eventually(session).Should(Say("--strategy Deployment strategy can be canary, rolling or null"))
Eventually(session).Should(Say(`--strategy\s+Deployment strategy can be canary, rolling or null`))
Eventually(session).Should(Say("--max-in-flight"))
Eventually(session).Should(Say("--no-wait Exit when the first instance of the web process is healthy"))
Eventually(session).Should(Say("ENVIRONMENT:"))
Expand Down
4 changes: 2 additions & 2 deletions integration/v7/isolated/restart_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ var _ = Describe("restart command", func() {
Eventually(session).Should(Say("ALIAS:"))
Eventually(session).Should(Say("rs"))
Eventually(session).Should(Say("OPTIONS:"))
Eventually(session).Should(Say("--strategy Deployment strategy can be canary, rolling or null."))
Eventually(session).Should(Say("--no-wait Exit when the first instance of the web process is healthy"))
Eventually(session).Should(Say(`--strategy\s+Deployment strategy can be canary, rolling or null.`))
Eventually(session).Should(Say(`--no-wait\s+Exit when the first instance of the web process is healthy`))
Eventually(session).Should(Say("--max-in-flight"))
Eventually(session).Should(Say("ENVIRONMENT:"))
Eventually(session).Should(Say(`CF_STAGING_TIMEOUT=15\s+Max wait time for staging, in minutes`))
Expand Down

0 comments on commit 07fd1bd

Please sign in to comment.