mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
api: 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
4911e9de4a
@@ -47,7 +47,7 @@ func MakeService(name string, tweaks ...Tweak) *api.Service {
|
||||
// Default to ClusterIP
|
||||
SetTypeClusterIP(svc)
|
||||
// Default to 1 port
|
||||
SetPorts(MakeServicePort("", 93, intstr.FromInt(76), api.ProtocolTCP))(svc)
|
||||
SetPorts(MakeServicePort("", 93, intstr.FromInt32(76), api.ProtocolTCP))(svc)
|
||||
|
||||
for _, tweak := range tweaks {
|
||||
tweak(svc)
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestFindPort(t *testing.T) {
|
||||
}{{
|
||||
name: "valid int, no ports",
|
||||
containers: []v1.Container{{}},
|
||||
port: intstr.FromInt(93),
|
||||
port: intstr.FromInt32(93),
|
||||
expected: 93,
|
||||
pass: true,
|
||||
}, {
|
||||
@@ -55,7 +55,7 @@ func TestFindPort(t *testing.T) {
|
||||
ContainerPort: 22,
|
||||
Protocol: "TCP",
|
||||
}}}},
|
||||
port: intstr.FromInt(93),
|
||||
port: intstr.FromInt32(93),
|
||||
expected: 93,
|
||||
pass: true,
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user