diff --git a/pkg/function/scale_workload.go b/pkg/function/scale_workload.go index 419c056786..5acae60a01 100644 --- a/pkg/function/scale_workload.go +++ b/pkg/function/scale_workload.go @@ -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)