| 197 | } |
| 198 | |
| 199 | func applyScaleOpts(project *types.Project, opts []string) error { |
| 200 | for _, scale := range opts { |
| 201 | name, val, ok := strings.Cut(scale, "=") |
| 202 | if !ok || val == "" { |
| 203 | return fmt.Errorf("invalid --scale option %q. Should be SERVICE=NUM", scale) |
| 204 | } |
| 205 | replicas, err := strconv.Atoi(val) |
| 206 | if err != nil { |
| 207 | return err |
| 208 | } |
| 209 | err = setServiceScale(project, name, replicas) |
| 210 | if err != nil { |
| 211 | return err |
| 212 | } |
| 213 | } |
| 214 | return nil |
| 215 | } |
| 216 | |
| 217 | func (opts createOptions) isPullPolicyValid() bool { |
| 218 | pullPolicies := []string{ |