Skip to content

Commit

Permalink
correct scale error messages formatting
Browse files Browse the repository at this point in the history
Co-authored-by: Milas Bowman <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
  • Loading branch information
glours and milas committed Sep 8, 2023
1 parent 0f8bb48 commit b69cea4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/compose/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ func parseServicesReplicasArgs(args []string) (map[string]int, error) {
for _, arg := range args {
key, val, ok := strings.Cut(arg, "=")
if !ok || key == "" || val == "" {
return nil, errors.Errorf("Invalide scale specifier %q.", arg)
return nil, errors.Errorf("invalid scale specifier: %s", arg)
}

Check warning on line 99 in cmd/compose/scale.go

View check run for this annotation

Codecov / codecov/patch

cmd/compose/scale.go#L98-L99

Added lines #L98 - L99 were not covered by tests
intValue, err := strconv.Atoi(val)

if err != nil {
return nil, errors.Errorf("Invalide scale specifier, can't parse replicate value to int %q.", arg)
return nil, errors.Errorf("invalid scale specifier: can't parse replica value as int: %v", arg)
}

Check warning on line 104 in cmd/compose/scale.go

View check run for this annotation

Codecov / codecov/patch

cmd/compose/scale.go#L103-L104

Added lines #L103 - L104 were not covered by tests
serviceReplicaTuples[key] = intValue
}
Expand Down

0 comments on commit b69cea4

Please sign in to comment.