Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fake dynamic client: document that List does not preserve TypeMeta in UnstructuredList #95117

Merged
merged 1 commit into from Oct 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion staging/src/k8s.io/client-go/dynamic/fake/simple.go
Expand Up @@ -35,7 +35,9 @@ import (

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
// 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{})

codecs := serializer.NewCodecFactory(scheme)
Expand Down