api-machinery: 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>

Kubernetes-commit: 94410ee8078971b8894e5c400ce3fc79f02bc510
This commit is contained in:
Stephen Kitt 2023-03-14 16:17:48 +01:00 committed by Kubernetes Publisher
parent 337feac705
commit 20433f9965

View File

@ -1465,7 +1465,7 @@ func TestDoRequestNewWay(t *testing.T) {
expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{
Protocol: "TCP",
Port: 12345,
TargetPort: intstr.FromInt(12345),
TargetPort: intstr.FromInt32(12345),
}}}}
expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj)
fakeHandler := utiltesting.FakeHandler{
@ -1708,7 +1708,7 @@ func TestDoRequestNewWayReader(t *testing.T) {
expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{
Protocol: "TCP",
Port: 12345,
TargetPort: intstr.FromInt(12345),
TargetPort: intstr.FromInt32(12345),
}}}}
expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj)
fakeHandler := utiltesting.FakeHandler{
@ -1747,7 +1747,7 @@ func TestDoRequestNewWayObj(t *testing.T) {
expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{
Protocol: "TCP",
Port: 12345,
TargetPort: intstr.FromInt(12345),
TargetPort: intstr.FromInt32(12345),
}}}}
expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj)
fakeHandler := utiltesting.FakeHandler{
@ -1802,7 +1802,7 @@ func TestDoRequestNewWayFile(t *testing.T) {
expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{
Protocol: "TCP",
Port: 12345,
TargetPort: intstr.FromInt(12345),
TargetPort: intstr.FromInt32(12345),
}}}}
expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj)
fakeHandler := utiltesting.FakeHandler{
@ -1847,7 +1847,7 @@ func TestWasCreated(t *testing.T) {
expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{
Protocol: "TCP",
Port: 12345,
TargetPort: intstr.FromInt(12345),
TargetPort: intstr.FromInt32(12345),
}}}}
expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj)
fakeHandler := utiltesting.FakeHandler{