This commit does two things in pkg package:

1. Remove unused ptr functions.
2. Replace ptr functions with k8s.io/utils/pointer
This commit is contained in:
WanLinghao
2019-02-23 13:06:47 +08:00
parent 4a1da48d11
commit d0138ca3fe
20 changed files with 75 additions and 97 deletions

View File

@@ -41,6 +41,7 @@ import (
iptablestest "k8s.io/kubernetes/pkg/util/iptables/testing"
"k8s.io/utils/exec"
fakeexec "k8s.io/utils/exec/testing"
utilpointer "k8s.io/utils/pointer"
)
func checkAllLines(t *testing.T, table utiliptables.Table, save []byte, expectedLines map[utiliptables.Chain]string) {
@@ -845,10 +846,6 @@ func TestNodePortReject(t *testing.T) {
}
}
func strPtr(s string) *string {
return &s
}
func TestOnlyLocalLoadBalancing(t *testing.T) {
ipt := iptablestest.NewFake()
fp := NewFakeProxier(ipt)
@@ -895,7 +892,7 @@ func TestOnlyLocalLoadBalancing(t *testing.T) {
NodeName: nil,
}, {
IP: epIP2,
NodeName: strPtr(testHostname),
NodeName: utilpointer.StringPtr(testHostname),
}},
Ports: []v1.EndpointPort{{
Name: svcPortName.Port,
@@ -989,7 +986,7 @@ func onlyLocalNodePorts(t *testing.T, fp *Proxier, ipt *iptablestest.FakeIPTable
NodeName: nil,
}, {
IP: epIP2,
NodeName: strPtr(testHostname),
NodeName: utilpointer.StringPtr(testHostname),
}},
Ports: []v1.EndpointPort{{
Name: svcPortName.Port,