mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Preserve metadata for fake dynamic client unstructured lists
Signed-off-by: Harsimran Singh Maan <maan.harry@gmail.com>
This commit is contained in:
parent
64b98495ec
commit
ac904454c2
@ -387,7 +387,10 @@ func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOption
|
||||
}
|
||||
|
||||
list := &unstructured.UnstructuredList{}
|
||||
list.SetRemainingItemCount(entireList.GetRemainingItemCount())
|
||||
list.SetSelfLink(entireList.GetSelfLink())
|
||||
list.SetResourceVersion(entireList.GetResourceVersion())
|
||||
list.SetContinue(entireList.GetContinue())
|
||||
list.GetObjectKind().SetGroupVersionKind(listGVK)
|
||||
for i := range entireList.Items {
|
||||
item := &entireList.Items[i]
|
||||
|
@ -178,7 +178,9 @@ func Test_ListKind(t *testing.T) {
|
||||
"apiVersion": "group/version",
|
||||
"kind": "TheKindList",
|
||||
"metadata": map[string]interface{}{
|
||||
"continue": "",
|
||||
"resourceVersion": "",
|
||||
"selfLink": "",
|
||||
},
|
||||
},
|
||||
Items: []unstructured.Unstructured{
|
||||
|
Loading…
Reference in New Issue
Block a user