Remove Selflink from convertors
Kubernetes-commit: 2169997dfea0a2f7ccf6911a745fc295793f70b4
This commit is contained in:
parent
2d144f4c39
commit
e6794552b0
|
@ -244,7 +244,6 @@ func asPartialObjectMetadataList(result runtime.Object, groupVersion schema.Grou
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list.SelfLink = li.GetSelfLink()
|
||||
list.ResourceVersion = li.GetResourceVersion()
|
||||
list.Continue = li.GetContinue()
|
||||
list.RemainingItemCount = li.GetRemainingItemCount()
|
||||
|
@ -265,7 +264,6 @@ func asPartialObjectMetadataList(result runtime.Object, groupVersion schema.Grou
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list.SelfLink = li.GetSelfLink()
|
||||
list.ResourceVersion = li.GetResourceVersion()
|
||||
list.Continue = li.GetContinue()
|
||||
list.RemainingItemCount = li.GetRemainingItemCount()
|
||||
|
|
|
@ -171,7 +171,6 @@ func TestAsPartialObjectMetadataList(t *testing.T) {
|
|||
var remainingItemCount int64 = 10
|
||||
pods := &examplev1.PodList{
|
||||
ListMeta: metav1.ListMeta{
|
||||
SelfLink: "/test/link",
|
||||
ResourceVersion: "10",
|
||||
Continue: "continuetoken",
|
||||
RemainingItemCount: &remainingItemCount,
|
||||
|
|
|
@ -1453,13 +1453,12 @@ func (t *Tester) testListTableConversion(obj runtime.Object, assignFn AssignFunc
|
|||
}
|
||||
m.SetContinue("continuetoken")
|
||||
m.SetResourceVersion("11")
|
||||
m.SetSelfLink("/list/link")
|
||||
|
||||
table, err := t.storage.(rest.TableConvertor).ConvertToTable(ctx, listObj, nil)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
if table.ResourceVersion != "11" || table.SelfLink != "/list/link" || table.Continue != "continuetoken" {
|
||||
if table.ResourceVersion != "11" || table.Continue != "continuetoken" {
|
||||
t.Errorf("printer lost list meta: %#v", table.ListMeta)
|
||||
}
|
||||
if len(table.Rows) != len(items) {
|
||||
|
|
|
@ -70,13 +70,11 @@ func (c defaultTableConvertor) ConvertToTable(ctx context.Context, object runtim
|
|||
}
|
||||
if m, err := meta.ListAccessor(object); err == nil {
|
||||
table.ResourceVersion = m.GetResourceVersion()
|
||||
table.SelfLink = m.GetSelfLink()
|
||||
table.Continue = m.GetContinue()
|
||||
table.RemainingItemCount = m.GetRemainingItemCount()
|
||||
} else {
|
||||
if m, err := meta.CommonAccessor(object); err == nil {
|
||||
table.ResourceVersion = m.GetResourceVersion()
|
||||
table.SelfLink = m.GetSelfLink()
|
||||
}
|
||||
}
|
||||
if opt, ok := tableOptions.(*metav1.TableOptions); !ok || !opt.NoHeaders {
|
||||
|
|
Loading…
Reference in New Issue