-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add generic helpers to kube-core #428
Comments
Hi @clux, reviving this old issue to inquire regarding its status, specifically about helpers for owner refs. I've been porting a subset of controllerutils to Rust to implement functions like |
Yeah, helpers like that would be very much appreciated! I think we have some logic like this already inside the finalizer helper that is utilizing jsonpatches. I personally always wanted that stuff to be a bit easier, at least for standard stuff, so implementations / sketches / ideas here here would be welcome. Thinking this stuff would probably live in the core crate (if it's using jsonpatch), and then re-used down the line (e.g. the finalizer helper). If it's in core i am sure it would attract a bit of bikeshedding though :D |
My helpers do not interact with any API by themselves. They're a straight port of controllerutil and only modify the Resource. For instance here is the signature for fn set_controller_reference<O: Resource, K: Resource>(owner: &O, controlled: &mut K,) -> Result<(), AlreadyOwnedError> |
Ah, that type of module would also probably work inside core, not what I expected, but it's probably easier than combining json patches, and it's a clever signature. |
Yeah.. I think finalizers are a kind of special case, since they have "fun" timing requirements (the finalizer MUST be acknowledged by K8s BEFORE we start performing work that they'd clean up, and so on). Most should be fine to just integrate with the regular batching. |
It would be nice to have ports of |
Lots of use cases for adding helpers when dealing with common interfaces like:
PartialObjectMetaExt
- GenericizePartialObjectMeta
over the underlyingResource
#1152Resource::controller_owner_ref
can be plumbed into aResource::owner_references_mut
ObjectMetaExt
or similar trait for stuff like https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil ?CustomResourceExt
define a CustomResourceExt in kube for kube-derive #497CustomResourceDefinitionExt
? if there are more things like thisResourceExt
Change Resource trait #486This issue is an umbrella issue to cross-link
utils
, plus a place to discuss a possible feature'd module in kube, or a kube-utils crate.The text was updated successfully, but these errors were encountered: