In the older version of the logic where we were reading replicas of workload in ScaleWorkload function; if val (string type) has an int value that is beyond the range of int32, even though call strconv.Atoi(val) would succeed, the next of replicas = int32(v) would result into unexpected result because the val is beyond what can be accommodated into int32 type.
This change fixes that.
Pull request type
Please check the type of change your PR introduces:
[ ] :construction: Work in Progress
[ ] :rainbow: Refactoring (no functional changes, no api changes)
/kanister/pkg/function (fix-codescanning-incorrect-intconv*) » go test -check.f "ScaleWorkloadSuite"
OK: 1 passed
PASS
ok github.com/kanisterio/kanister/pkg/function 0.894s
Change Overview
Fixes https://github.com/kanisterio/kanister/issues/3202
In the older version of the logic where we were reading replicas of workload in
ScaleWorkload
function; if val (string type) has an int value that is beyond the range of int32, even though callstrconv.Atoi(val)
would succeed, the next ofreplicas = int32(v)
would result into unexpected result because the val is beyond what can be accommodated into int32 type. This change fixes that.Pull request type
Please check the type of change your PR introduces:
Issues
Test Plan