Skip to content

Commit

Permalink
Merge pull request kubernetes#80859 from wojtek-t/fix_selflinks_in_tests
Browse files Browse the repository at this point in the history
Fix selflinks in tests
  • Loading branch information
k8s-ci-robot authored Aug 1, 2019
2 parents 2b7b54b + bc00248 commit 3287bf7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/cronjob/injection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2439,15 +2439,15 @@ 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),
},
"PersistentVolumeDescriber": &PersistentVolumeDescriber{
fake.NewSimpleClientset(&corev1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
Name: "bar",
SelfLink: "url/url/url/url",
SelfLink: "/api/v1/persistentvolumes/bar",
},
}, events),
},
Expand All @@ -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),
},
Expand Down
2 changes: 1 addition & 1 deletion test/integration/events/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3287bf7

Please sign in to comment.