MCPcopy Index your code
hub / github.com/cloudfoundry/cli / ValidateFlags

Method ValidateFlags

command/v7/rollback_command.go:150–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148}
149
150func (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}

Callers 1

ExecuteMethod · 0.95

Calls 3

MinimumCCAPIVersionCheckFunction · 0.92
validateInstanceStepsFunction · 0.85
APIVersionMethod · 0.65

Tested by

no test coverage detected