mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-26 15:12:06 +00:00
fake dynamic client: document that List does not preserve TypeMeta in UnstructuredList
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com> Kubernetes-commit: deb1bb8bfff012e03ccc80fd85ee4fc2f9fceb6d
This commit is contained in:
parent
b8dd4e3c0f
commit
f45d9426eb
@ -35,7 +35,9 @@ import (
|
|||||||
|
|
||||||
func NewSimpleDynamicClient(scheme *runtime.Scheme, objects ...runtime.Object) *FakeDynamicClient {
|
func NewSimpleDynamicClient(scheme *runtime.Scheme, objects ...runtime.Object) *FakeDynamicClient {
|
||||||
// In order to use List with this client, you have to have the v1.List registered in your scheme. Neat thing though
|
// In order to use List with this client, you have to have the v1.List registered in your scheme. Neat thing though
|
||||||
// it does NOT have to be the *same* list
|
// it does NOT have to be the *same* list. UnstructuredList returned from this fake client will NOT have apiVersion and kind set,
|
||||||
|
// but each Unstructured object in Items will preserve their respective apiVersion and kind. As a result, schema conversion for
|
||||||
|
// *List kinds will not work and conversion of each Unstructured object in Items will be required instead.
|
||||||
scheme.AddKnownTypeWithName(schema.GroupVersionKind{Group: "fake-dynamic-client-group", Version: "v1", Kind: "List"}, &unstructured.UnstructuredList{})
|
scheme.AddKnownTypeWithName(schema.GroupVersionKind{Group: "fake-dynamic-client-group", Version: "v1", Kind: "List"}, &unstructured.UnstructuredList{})
|
||||||
|
|
||||||
codecs := serializer.NewCodecFactory(scheme)
|
codecs := serializer.NewCodecFactory(scheme)
|
||||||
|
Loading…
Reference in New Issue
Block a user