From bc00248e719012ed354829d6382e4353ea1bc21d Mon Sep 17 00:00:00 2001 From: wojtekt Date: Thu, 1 Aug 2019 15:46:46 +0200 Subject: [PATCH] Fix selflinks in tests --- pkg/controller/cronjob/injection.go | 2 +- .../k8s.io/kubectl/pkg/describe/versioned/describe_test.go | 6 +++--- test/integration/events/events_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/controller/cronjob/injection.go b/pkg/controller/cronjob/injection.go index 14831fe1f6e3f..b4b1bb8042f99 100644 --- a/pkg/controller/cronjob/injection.go +++ b/pkg/controller/cronjob/injection.go @@ -141,7 +141,7 @@ func (f *fakeJobControl) CreateJob(namespace string, job *batchv1.Job) (*batchv1 if f.Err != nil { return nil, f.Err } - job.SelfLink = fmt.Sprintf("/api/batch/v1/namespaces/%s/jobs/%s", namespace, job.Name) + job.SelfLink = fmt.Sprintf("/apis/batch/v1/namespaces/%s/jobs/%s", namespace, job.Name) f.Jobs = append(f.Jobs, *job) job.UID = "test-uid" return job, nil diff --git a/staging/src/k8s.io/kubectl/pkg/describe/versioned/describe_test.go b/staging/src/k8s.io/kubectl/pkg/describe/versioned/describe_test.go index 95ab591fb83df..b3be6add569b1 100644 --- a/staging/src/k8s.io/kubectl/pkg/describe/versioned/describe_test.go +++ b/staging/src/k8s.io/kubectl/pkg/describe/versioned/describe_test.go @@ -2439,7 +2439,7 @@ func TestDescribeEvents(t *testing.T) { fake.NewSimpleClientset(&corev1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "bar", - SelfLink: "url/url/url/url", + SelfLink: "/api/v1/nodes/bar", }, }, events), }, @@ -2447,7 +2447,7 @@ func TestDescribeEvents(t *testing.T) { fake.NewSimpleClientset(&corev1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ Name: "bar", - SelfLink: "url/url/url/url", + SelfLink: "/api/v1/persistentvolumes/bar", }, }, events), }, @@ -2456,7 +2456,7 @@ func TestDescribeEvents(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "bar", Namespace: "foo", - SelfLink: "url/url/url/url", + SelfLink: "/api/v1/namespaces/foo/pods/bar", }, }, events), }, diff --git a/test/integration/events/events_test.go b/test/integration/events/events_test.go index 3df8c3b2d56bf..ecda5e2d976c5 100644 --- a/test/integration/events/events_test.go +++ b/test/integration/events/events_test.go @@ -42,7 +42,7 @@ func TestEventCompatibility(t *testing.T) { testPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - SelfLink: "/api/version/pods/foo", + SelfLink: "/api/v1/namespaces/default/pods/foo", Name: "foo", Namespace: "default", UID: "bar",