Stop setting selfLink in kubectl

Kubernetes-commit: 9015f27e6d8295d7dcdbf5915024f28cc00d4d2f
This commit is contained in:
Wojciech Tyczyński 2022-02-16 17:13:54 +01:00 committed by Kubernetes Publisher
parent 26ede5e6c7
commit 3f11f31017
3 changed files with 4 additions and 11 deletions

View File

@ -813,7 +813,6 @@ func (o *GetOptions) printGeneric(r *resource.Result) error {
}
if listMeta, err := meta.ListAccessor(obj); err == nil {
list.Object["metadata"] = map[string]interface{}{
"selfLink": listMeta.GetSelfLink(),
"resourceVersion": listMeta.GetResourceVersion(),
}
}

View File

@ -676,7 +676,6 @@ func TestGetEmptyTable(t *testing.T) {
"kind":"Table",
"apiVersion":"meta.k8s.io/v1beta1",
"metadata":{
"selfLink":"/api/v1/namespaces/default/pods",
"resourceVersion":"346"
},
"columnDefinitions":[
@ -1297,8 +1296,7 @@ func TestGetMixedGenericObjects(t *testing.T) {
],
"kind": "List",
"metadata": {
"resourceVersion": "",
"selfLink": ""
"resourceVersion": ""
}
}
`
@ -1476,8 +1474,7 @@ func TestGetMultipleTypeObjectsAsList(t *testing.T) {
],
"kind": "List",
"metadata": {
"resourceVersion": "",
"selfLink": ""
"resourceVersion": ""
}
}
`

View File

@ -3929,16 +3929,14 @@ func TestDescribeEvents(t *testing.T) {
"NodeDescriber": &NodeDescriber{
fake.NewSimpleClientset(&corev1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "bar",
SelfLink: "/api/v1/nodes/bar",
Name: "bar",
},
}, events),
},
"PersistentVolumeDescriber": &PersistentVolumeDescriber{
fake.NewSimpleClientset(&corev1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
Name: "bar",
SelfLink: "/api/v1/persistentvolumes/bar",
Name: "bar",
},
}, events),
},
@ -3947,7 +3945,6 @@ func TestDescribeEvents(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "bar",
Namespace: "foo",
SelfLink: "/api/v1/namespaces/foo/pods/bar",
},
}, events),
},