mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Remove Selflink from convertors
This commit is contained in:
parent
8c1e8355f8
commit
2169997dfe
@ -110,13 +110,11 @@ func (h *HumanReadableGenerator) GenerateTable(obj runtime.Object, options Gener
|
||||
}
|
||||
if m, err := meta.ListAccessor(obj); err == nil {
|
||||
table.ResourceVersion = m.GetResourceVersion()
|
||||
table.SelfLink = m.GetSelfLink()
|
||||
table.Continue = m.GetContinue()
|
||||
table.RemainingItemCount = m.GetRemainingItemCount()
|
||||
} else {
|
||||
if m, err := meta.CommonAccessor(obj); err == nil {
|
||||
table.ResourceVersion = m.GetResourceVersion()
|
||||
table.SelfLink = m.GetSelfLink()
|
||||
}
|
||||
}
|
||||
return table, nil
|
||||
|
@ -90,13 +90,11 @@ func (c *convertor) ConvertToTable(ctx context.Context, obj runtime.Object, tabl
|
||||
|
||||
if m, err := meta.ListAccessor(obj); err == nil {
|
||||
table.ResourceVersion = m.GetResourceVersion()
|
||||
table.SelfLink = m.GetSelfLink()
|
||||
table.Continue = m.GetContinue()
|
||||
table.RemainingItemCount = m.GetRemainingItemCount()
|
||||
} else {
|
||||
if m, err := meta.CommonAccessor(obj); err == nil {
|
||||
table.ResourceVersion = m.GetResourceVersion()
|
||||
table.SelfLink = m.GetSelfLink()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -83,13 +83,11 @@ func (c *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOpti
|
||||
}
|
||||
if m, err := meta.ListAccessor(obj); err == nil {
|
||||
table.ResourceVersion = m.GetResourceVersion()
|
||||
table.SelfLink = m.GetSelfLink()
|
||||
table.Continue = m.GetContinue()
|
||||
table.RemainingItemCount = m.GetRemainingItemCount()
|
||||
} else {
|
||||
if m, err := meta.CommonAccessor(obj); err == nil {
|
||||
table.ResourceVersion = m.GetResourceVersion()
|
||||
table.SelfLink = m.GetSelfLink()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user