Navigation Menu

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

Shared home for k8s resource type information? #54104

Closed
jpbetz opened this issue Oct 17, 2017 · 5 comments
Closed

Shared home for k8s resource type information? #54104

jpbetz opened this issue Oct 17, 2017 · 5 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@jpbetz
Copy link
Contributor

jpbetz commented Oct 17, 2017

For both auger and a declarative application management tool prototype @monopole has been working on, there is a need to depend on the resource type information in the main kubernetes repo:

  • k8s.io/kubernetes/pkg/api (for api.Registry and api.Codecs)
  • k8s.io/kubernetes/pkg/kubeapiserver/options (which registers the "" group on init)

Currently, the only possible approach is to vendor in all of k8s.io/kubernetes, which is not intended to be vendored.

If kubectl were to be split out into it's own repo (I heard a rumor this might happen) then would it be reasonable to move the api registry and codecs up into a shared common project as well?

See also:

/kind feature

@jpbetz jpbetz added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Oct 17, 2017
@jpbetz jpbetz self-assigned this Oct 17, 2017
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 17, 2017
@mbohlool
Copy link
Contributor

cc @caesarxuchao

@bgrant0607
Copy link
Member

Is this not https://github.com/kubernetes/api ?

@jpbetz
Copy link
Contributor Author

jpbetz commented Nov 3, 2017

@caesarxuchao also suggested I should be able to do everything via https://github.com/kubernetes/api. Here's an example I'm going to try to crib from https://github.com/kubernetes/client-go/blob/076e344c86e52f088b78615f815b245f6d613537/kubernetes/fake/register.go

@jpbetz
Copy link
Contributor Author

jpbetz commented Nov 3, 2017

@jpbetz
Copy link
Contributor Author

jpbetz commented Nov 3, 2017

@caesarxuchao showed me the correct way to do this: Register all needed types from k8s.io/api like done by client-go's scheme/register.go and use serializer.DirectCodecFactory to create codecs using registered types.

See jpbetz/auger#5 for details.

@jpbetz jpbetz closed this as completed Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

4 participants