Skip to content

Make convertToVersion strict on empty kind #5

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

Open
wants to merge 6 commits into
base: crd_versioning_nop
Choose a base branch
from

Conversation

sttts
Copy link

@sttts sttts commented May 15, 2018

In the normal scheme we know the full set of registered GVKs of a given object in convertToVersion (https://github.com/sttts/kubernetes/blob/c5445d3c56e06ab366b9cca34bd69c5cc386ec47/staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go#L542). In the case of Unstructured, we have no clue. By setting the GVK in the object we get this information.

Native types' NewFuncs() only return the internal object. For the upper reason this is enough to get the API group.

store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &unstructured.Unstructured{} },
NewFunc: func() runtime.Object {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively we could change convertToVersion to know the GVK instead of deriving it from the Unstructured object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants