apps: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or values which are already int32s, or int variables which are defined close by and can be changed to int32s with little impact. Signed-off-by: Stephen Kitt <skitt@redhat.com>
This commit is contained in:

committed by
Stephen Kitt

parent
f871d5fabe
commit
5bfe738af2
@@ -975,22 +975,22 @@ func TestMaxUnavailable(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "maxUnavailable less than replicas",
|
||||
deployment: deployment(10, intstr.FromInt(5)),
|
||||
deployment: deployment(10, intstr.FromInt32(5)),
|
||||
expected: int32(5),
|
||||
},
|
||||
{
|
||||
name: "maxUnavailable equal replicas",
|
||||
deployment: deployment(10, intstr.FromInt(10)),
|
||||
deployment: deployment(10, intstr.FromInt32(10)),
|
||||
expected: int32(10),
|
||||
},
|
||||
{
|
||||
name: "maxUnavailable greater than replicas",
|
||||
deployment: deployment(5, intstr.FromInt(10)),
|
||||
deployment: deployment(5, intstr.FromInt32(10)),
|
||||
expected: int32(5),
|
||||
},
|
||||
{
|
||||
name: "maxUnavailable with replicas is 0",
|
||||
deployment: deployment(0, intstr.FromInt(10)),
|
||||
deployment: deployment(0, intstr.FromInt32(10)),
|
||||
expected: int32(0),
|
||||
},
|
||||
{
|
||||
@@ -1277,22 +1277,22 @@ func TestMinAvailable(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "replicas greater than maxUnavailable",
|
||||
deployment: deployment(10, intstr.FromInt(5)),
|
||||
deployment: deployment(10, intstr.FromInt32(5)),
|
||||
expected: 5,
|
||||
},
|
||||
{
|
||||
name: "replicas equal maxUnavailable",
|
||||
deployment: deployment(10, intstr.FromInt(10)),
|
||||
deployment: deployment(10, intstr.FromInt32(10)),
|
||||
expected: 0,
|
||||
},
|
||||
{
|
||||
name: "replicas less than maxUnavailable",
|
||||
deployment: deployment(5, intstr.FromInt(10)),
|
||||
deployment: deployment(5, intstr.FromInt32(10)),
|
||||
expected: 0,
|
||||
},
|
||||
{
|
||||
name: "replicas is 0",
|
||||
deployment: deployment(0, intstr.FromInt(10)),
|
||||
deployment: deployment(0, intstr.FromInt32(10)),
|
||||
expected: 0,
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user