From 9e82b7b20574399a931ccd6cf745cf5ba43f486f Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Fri, 25 Oct 2024 17:41:22 +0200 Subject: [PATCH] Fix incorrect conversion between int types --- pkg/function/scale_workload.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)