-
-
Notifications
You must be signed in to change notification settings - Fork 366
Description
Would you like to work on this feature?
yes
What problem are you trying to solve?
Currently, Controller.run() returns ObjectRef<K> objects, while Recorder takes ObjectReferences. These mostly fulfil the same purpose, but are currently incompatible. In particular, the type fields of ObjectRef<K> are hidden from the user, and ObjectRef<K> does not track UIDs. On the other hand, ObjectRef<K> provides nicer string formatting, is slightly more efficient, and offers optional type safety.
Describe the solution you'd like
- Track object UIDs in
ObjectRef - Make it easy to convert an
ObjectRef<K>intoObjectReference - Make
RecordertakeObjectRef<K>rather thanObjectReference
Describe alternatives you've considered
We could also standardize on ObjectReference, but I'm not sure the drawbacks there are worth it.
Documentation, Adoption, Migration Strategy
Should object UIDs participate in ObjectRef equality? I'm inclined to say no for backwards compatibility reasons, but that would be inconsistent with ObjectReference.
Perhaps a middle ground would be to say that they participate in equality IFF uid.is_some() on both sides, but that also feels like a bit of a footgun...
Target crate for feature
kube-runtime