mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +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 := &unstructured.UnstructuredList{}
|
||||||
|
list.SetRemainingItemCount(entireList.GetRemainingItemCount())
|
||||||
|
list.SetSelfLink(entireList.GetSelfLink())
|
||||||
list.SetResourceVersion(entireList.GetResourceVersion())
|
list.SetResourceVersion(entireList.GetResourceVersion())
|
||||||
|
list.SetContinue(entireList.GetContinue())
|
||||||
list.GetObjectKind().SetGroupVersionKind(listGVK)
|
list.GetObjectKind().SetGroupVersionKind(listGVK)
|
||||||
for i := range entireList.Items {
|
for i := range entireList.Items {
|
||||||
item := &entireList.Items[i]
|
item := &entireList.Items[i]
|
||||||
|
@ -178,7 +178,9 @@ func Test_ListKind(t *testing.T) {
|
|||||||
"apiVersion": "group/version",
|
"apiVersion": "group/version",
|
||||||
"kind": "TheKindList",
|
"kind": "TheKindList",
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
|
"continue": "",
|
||||||
"resourceVersion": "",
|
"resourceVersion": "",
|
||||||
|
"selfLink": "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Items: []unstructured.Unstructured{
|
Items: []unstructured.Unstructured{
|
||||||
|
Loading…
Reference in New Issue
Block a user