network: 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:
Stephen Kitt
2023-03-14 16:17:48 +01:00
committed by Stephen Kitt
parent f871d5fabe
commit 1c4b97ea27
7 changed files with 64 additions and 64 deletions

View File

@@ -1763,7 +1763,7 @@ func TestOverallIPTablesRulesWithMultipleServices(t *testing.T) {
Name: "p80",
Port: 80,
Protocol: v1.ProtocolTCP,
TargetPort: intstr.FromInt(80),
TargetPort: intstr.FromInt32(80),
}}
}),
// create LoadBalancer service with Cluster traffic policy and source ranges
@@ -1793,7 +1793,7 @@ func TestOverallIPTablesRulesWithMultipleServices(t *testing.T) {
Name: "p80",
Port: 80,
Protocol: v1.ProtocolTCP,
TargetPort: intstr.FromInt(80),
TargetPort: intstr.FromInt32(80),
}}
}),
)
@@ -5138,7 +5138,7 @@ func TestEndpointSliceE2E(t *testing.T) {
Spec: v1.ServiceSpec{
ClusterIP: "172.30.1.1",
Selector: map[string]string{"foo": "bar"},
Ports: []v1.ServicePort{{Name: "", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}},
Ports: []v1.ServicePort{{Name: "", TargetPort: intstr.FromInt32(80), Protocol: v1.ProtocolTCP}},
},
})
@@ -5198,7 +5198,7 @@ func TestHealthCheckNodePortWhenTerminating(t *testing.T) {
Spec: v1.ServiceSpec{
ClusterIP: "172.30.1.1",
Selector: map[string]string{"foo": "bar"},
Ports: []v1.ServicePort{{Name: "", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}},
Ports: []v1.ServicePort{{Name: "", TargetPort: intstr.FromInt32(80), Protocol: v1.ProtocolTCP}},
},
})
@@ -5801,7 +5801,7 @@ func TestEndpointSliceWithTerminatingEndpointsTrafficPolicyLocal(t *testing.T) {
Ports: []v1.ServicePort{
{
Name: "",
TargetPort: intstr.FromInt(80),
TargetPort: intstr.FromInt32(80),
Port: 80,
Protocol: v1.ProtocolTCP,
},
@@ -6598,7 +6598,7 @@ func TestEndpointSliceWithTerminatingEndpointsTrafficPolicyCluster(t *testing.T)
Ports: []v1.ServicePort{
{
Name: "",
TargetPort: intstr.FromInt(80),
TargetPort: intstr.FromInt32(80),
Port: 80,
Protocol: v1.ProtocolTCP,
},