Skip to content

Align event Recorder with Controller #812

@nightkr

Description

@nightkr

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

  1. Track object UIDs in ObjectRef
  2. Make it easy to convert an ObjectRef<K> into ObjectReference
  3. Make Recorder take ObjectRef<K> rather than ObjectReference

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    runtimecontroller runtime related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions