Skip to content

Conversation

@fabianvf
Copy link
Member

  • Always set apiVersion and kind for resources within a resource list

When the Kubernetes REST API returns a list of objects, it returns a
resource list object with an apiVersion and kind set to "KindList" where
"Kind" is the Kind of object queried, rather than an simple array of
objects.

The items property contains the array of resources returned. Each
resource in this list does not contain the GVK information, only the
resource list has an apiVersion or kind property set.

This ensures when a resource list is returned, each resource within the
list has it's apiVersion and kind set, to make it similar to other
Kubernetes clients, and easier to work with the returned resources.

  • Just do one big serialization at the end of a ResourceList operation

(cherry picked from commit 68cc0e3)

…penshift#298)

* Always set apiVersion and kind for resources within a resource list

When the Kubernetes REST API returns a list of objects, it returns a
resource list object with an apiVersion and kind set to "KindList" where
"Kind" is the Kind of object queried, rather than an simple array of
objects.

The `items` property contains the array of resources returned.  Each
resource in this list does not contain the GVK information, only the
resource list has an apiVersion or kind property set.

This ensures when a resource list is returned, each resource within the
list has it's apiVersion and kind set, to make it similar to other
Kubernetes clients, and easier to work with the returned resources.

* Just do one big serialization at the end of a ResourceList operation

(cherry picked from commit 68cc0e3)
@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 28, 2019
@chancez
Copy link
Contributor

chancez commented May 28, 2019

LGTM

@fabianvf fabianvf merged commit 5b32a84 into openshift:release-0.8 May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants