diff --git a/controllers/apps/components/base_stateful.go b/controllers/apps/components/base_stateful.go index 5c00452a665..6e4678ef32e 100644 --- a/controllers/apps/components/base_stateful.go +++ b/controllers/apps/components/base_stateful.go @@ -753,7 +753,7 @@ func (c *rsmComponentBase) leaveMember4ScaleIn(reqCtx intctrlutil.RequestCtx, cl } for _, pod := range pods { subs := strings.Split(pod.Name, "-") - if ordinal, err := strconv.Atoi(subs[len(subs)-1]); err != nil { + if ordinal, err := strconv.ParseInt(subs[len(subs)-1], 10, 32); err != nil { return err } else if int32(ordinal) < c.Component.Replicas { continue diff --git a/lorry/component/kafka/thirdparty/retry.go b/lorry/component/kafka/thirdparty/retry.go index 13bdfbcd306..a6f45d5fd98 100644 --- a/lorry/component/kafka/thirdparty/retry.go +++ b/lorry/component/kafka/thirdparty/retry.go @@ -232,7 +232,7 @@ func decodeString(f reflect.Type, t reflect.Type, data any) (any, error) { switch t.Kind() { case reflect.Uint: - val, err := strconv.ParseUint(dataString, 10, 64) + val, err := strconv.ParseUint(dataString, 10, 32) return uint(val), invalidError(err, "uint", dataString) case reflect.Uint64: @@ -253,9 +253,9 @@ func decodeString(f reflect.Type, t reflect.Type, data any) (any, error) { return uint8(val), invalidError(err, "uint8", dataString) case reflect.Int: - val, err := strconv.ParseInt(dataString, 10, 64) + val, err := strconv.Atoi(dataString) - return int(val), invalidError(err, "int", dataString) + return val, invalidError(err, "int", dataString) case reflect.Int64: val, err := strconv.ParseInt(dataString, 10, 64)