()
| 148 | } |
| 149 | |
| 150 | func (cmd RollbackCommand) ValidateFlags() error { |
| 151 | switch { |
| 152 | case cmd.MaxInFlight != nil && *cmd.MaxInFlight < 1: |
| 153 | return translatableerror.IncorrectUsageError{Message: "--max-in-flight must be greater than or equal to 1"} |
| 154 | case cmd.Strategy.Name != constant.DeploymentStrategyCanary && cmd.InstanceSteps != "": |
| 155 | return translatableerror.RequiredFlagsError{Arg1: "--instance-steps", Arg2: "--strategy=canary"} |
| 156 | case len(cmd.InstanceSteps) > 0 && !validateInstanceSteps(cmd.InstanceSteps): |
| 157 | return translatableerror.ParseArgumentError{ArgumentName: "--instance-steps", ExpectedType: "list of weights"} |
| 158 | } |
| 159 | |
| 160 | if len(cmd.InstanceSteps) > 0 { |
| 161 | return command.MinimumCCAPIVersionCheck(cmd.Config.APIVersion(), ccversion.MinVersionCanarySteps, "--instance-steps") |
| 162 | } |
| 163 | |
| 164 | return nil |
| 165 | } |
no test coverage detected