Remove selflink references in different testing-related files

This commit is contained in:
Wojciech Tyczyński
2022-01-13 11:33:26 +01:00
parent 8c6b910e68
commit 551790729f
14 changed files with 5 additions and 36 deletions

View File

@@ -18,7 +18,6 @@ package cronjob
import (
"context"
"fmt"
"sync"
batchv1 "k8s.io/api/batch/v1"
@@ -143,7 +142,6 @@ func (f *fakeJobControl) CreateJob(namespace string, job *batchv1.Job) (*batchv1
if f.CreateErr != nil {
return nil, f.CreateErr
}
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

View File

@@ -43,7 +43,6 @@ func TestGetJobFromTemplate2(t *testing.T) {
Name: "mycronjob",
Namespace: "snazzycats",
UID: types.UID("1a2b3c"),
SelfLink: "/apis/batch/v1/namespaces/snazzycats/jobs/mycronjob",
},
Spec: batchv1.CronJobSpec{
Schedule: "* * * * ?",

View File

@@ -209,7 +209,6 @@ func (tc *testCase) prepareTestClient(t *testing.T) (*fake.Clientset, *metricsfa
ObjectMeta: metav1.ObjectMeta{
Name: hpaName,
Namespace: namespace,
SelfLink: "experimental/v1/namespaces/" + namespace + "/horizontalpodautoscalers/" + hpaName,
},
Spec: autoscalingv2.HorizontalPodAutoscalerSpec{
ScaleTargetRef: autoscalingv2.CrossVersionObjectReference{
@@ -2876,7 +2875,6 @@ func TestAvoidUnnecessaryUpdates(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "test-hpa",
Namespace: "test-namespace",
SelfLink: "experimental/v1/namespaces/test-namespace/horizontalpodautoscalers/test-hpa",
},
Spec: autoscalingv2.HorizontalPodAutoscalerSpec{
ScaleTargetRef: autoscalingv2.CrossVersionObjectReference{

View File

@@ -404,8 +404,6 @@ func newClaim(name, claimUID, capacity, boundToVolume string, phase v1.Persisten
Phase: phase,
},
}
// Make sure ref.GetReference(claim) works
claim.ObjectMeta.SelfLink = "/api/v1/namespaces/" + testNamespace + "/persistentvolumeclaims/" + name
if len(annotations) > 0 {
claim.Annotations = make(map[string]string)

View File

@@ -1296,7 +1296,6 @@ func TestFindingPreboundVolumes(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "claim01",
Namespace: "myns",
SelfLink: "/api/v1/namespaces/myns/persistentvolumeclaims/claim01",
},
Spec: v1.PersistentVolumeClaimSpec{
AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce},