MCPcopy
hub / github.com/docker/compose / applyScaleOpts

Function applyScaleOpts

cmd/compose/create.go:199–215  ·  view source on GitHub ↗
(project *types.Project, opts []string)

Source from the content-addressed store, hash-verified

197}
198
199func 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
217func (opts createOptions) isPullPolicyValid() bool {
218 pullPolicies := []string{

Callers 2

TestApplyScaleOptFunction · 0.85
ApplyMethod · 0.85

Calls 1

setServiceScaleFunction · 0.85

Tested by 1

TestApplyScaleOptFunction · 0.68