Skip to content

Commit

Permalink
Fix incorrect conversion between int types
Browse files Browse the repository at this point in the history
  • Loading branch information
viveksinghggits committed Oct 25, 2024
1 parent 793523b commit 9e82b7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/function/scale_workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ func (s *scaleWorkloadFunc) setArgs(tp param.TemplateParams, args map[string]int
case int64:
replicas = int32(val)
case string:
var v int
if v, err = strconv.Atoi(val); err != nil {
v, err := strconv.ParseInt(val, 10, 32)
if err != nil {
return errkit.Wrap(err, fmt.Sprintf("Cannot convert %s to int", val))
}
replicas = int32(v)
Expand Down

0 comments on commit 9e82b7b

Please sign in to comment.