Remove use of testapi codecs, selflink, resourcepath functions
This commit is contained in:
@@ -41,7 +41,6 @@ import (
|
||||
fakecloud "k8s.io/cloud-provider/fake"
|
||||
servicehelper "k8s.io/cloud-provider/service/helpers"
|
||||
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
)
|
||||
|
||||
@@ -53,7 +52,7 @@ func newService(name string, uid types.UID, serviceType v1.ServiceType) *v1.Serv
|
||||
Name: name,
|
||||
Namespace: "default",
|
||||
UID: uid,
|
||||
SelfLink: testapi.Default.SelfLink("services", name),
|
||||
SelfLink: "/api/v1/namespaces/default/services/" + name,
|
||||
},
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: serviceType,
|
||||
@@ -145,7 +144,7 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "udp-service",
|
||||
Namespace: "default",
|
||||
SelfLink: testapi.Default.SelfLink("services", "udp-service"),
|
||||
SelfLink: "/api/v1/namespaces/default/services/udp-service",
|
||||
},
|
||||
Spec: v1.ServiceSpec{
|
||||
Ports: []v1.ServicePort{{
|
||||
@@ -166,7 +165,7 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "basic-service1",
|
||||
Namespace: "default",
|
||||
SelfLink: testapi.Default.SelfLink("services", "basic-service1"),
|
||||
SelfLink: "/api/v1/namespaces/default/services/basic-service1",
|
||||
},
|
||||
Spec: v1.ServiceSpec{
|
||||
Ports: []v1.ServicePort{{
|
||||
@@ -187,7 +186,7 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "sctp-service",
|
||||
Namespace: "default",
|
||||
SelfLink: testapi.Default.SelfLink("services", "sctp-service"),
|
||||
SelfLink: "/api/v1/namespaces/default/services/sctp-service",
|
||||
},
|
||||
Spec: v1.ServiceSpec{
|
||||
Ports: []v1.ServicePort{{
|
||||
@@ -234,7 +233,7 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "basic-service1",
|
||||
Namespace: "default",
|
||||
SelfLink: testapi.Default.SelfLink("services", "basic-service1"),
|
||||
SelfLink: "/api/v1/namespaces/default/services/basic-service1",
|
||||
DeletionTimestamp: &metav1.Time{
|
||||
Time: time.Now(),
|
||||
},
|
||||
@@ -267,7 +266,7 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "basic-service1",
|
||||
Namespace: "default",
|
||||
SelfLink: testapi.Default.SelfLink("services", "basic-service1"),
|
||||
SelfLink: "/api/v1/namespaces/default/services/basic-service1",
|
||||
},
|
||||
Spec: v1.ServiceSpec{
|
||||
Ports: []v1.ServicePort{{
|
||||
@@ -288,7 +287,7 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "basic-service1",
|
||||
Namespace: "default",
|
||||
SelfLink: testapi.Default.SelfLink("services", "basic-service1"),
|
||||
SelfLink: "/api/v1/namespaces/default/services/basic-service1",
|
||||
Finalizers: []string{servicehelper.LoadBalancerCleanupFinalizer},
|
||||
},
|
||||
Spec: v1.ServiceSpec{
|
||||
|
Reference in New Issue
Block a user