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

Define and implement equivalent k8s-openapi traits #4

Closed
5 tasks done
clux opened this issue Oct 26, 2021 · 3 comments · Fixed by #25
Closed
5 tasks done

Define and implement equivalent k8s-openapi traits #4

clux opened this issue Oct 26, 2021 · 3 comments · Fixed by #25

Comments

@clux
Copy link
Member

clux commented Oct 26, 2021

A thing that can be done in parallel to the implementation of the code-generation, is to sketch out the traits we need to implement in the codegen, and whether we need to rethink them a bit.

There is currently a bit of a disparity between k8s-openapi traits and kube_core's traits, and it would be nice if the traits we used in kube, were the traits defined either by kube_core or something here.

So here's a rough list of generics I think we should aim to implement / refine for this project to be successful:

wanted traits

Need at least these two to be able to implement kube::Resource upstream:

getter traits

Here? Or separate repo? I'm leaning towards defining a kube-traits crate within the kube-rs org and implementing it here.
But open to ideas. Also, anything missing from this list?

Descoped

These could maybe be done later for even more generic action.

  • verb traits for subresources (e.g. Log - these should probably not live in kube-client)
  • verb traits for normal resources - enables neokubism Project Neokubism kube#594
@kazk

This comment has been minimized.

@clux clux moved this to Defining in Kube Roadmap Oct 26, 2021
@clux clux mentioned this issue Nov 3, 2021
@clux
Copy link
Member Author

clux commented Nov 3, 2021

Updated to reflect progress.

@clux clux moved this from Defining to In Progress in Kube Roadmap Nov 3, 2021
@clux clux changed the title Define the generics we need Define and implement equivalent k8s-openapi traits Dec 19, 2023
clux added a commit that referenced this issue Dec 19, 2023
clux added a commit that referenced this issue Dec 19, 2023
For #4

Note because of #26 we only
actually need to implement 2 scopes; cluster + namespaced as the
subresource scopes are not yet captured.
@clux
Copy link
Member Author

clux commented Dec 19, 2023

Have added Scope and aligned the in-house Resource trait with the one in k8s-openapi now. This means it is theoretically possible to impl<K: k8s_pb::Resource> kube::Resource for K` in the same way as kube_core does it.

There are potentially more improvements here, but starting out with the full verb soup generics is probably overkill. Closing this as sufficient to get going for now, but open to improvements in the future.

@clux clux closed this as completed Dec 19, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Kube Roadmap Dec 19, 2023
@clux clux linked a pull request Dec 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants