Skip to content

[simple.App] Finalize Conversion UX #617

Open
@IfSentient

Description

@IfSentient

Right now, simple.App uses a map of schema.GroupVersion to simple.Converter (which is an alias to k8s.Converter) to register conversion behavior for managed kinds. This is a bit unwieldy, as it essentially just mimics the raw conversion webhook behavior. We should determine a better UX for managing conversion in kinds.

One such approach would be requiring an internal version of the kind, like apiservers do, and having each non-internal version expose a ToInternal/FromInternal function. For this, we would need to solve how this could be generated and allow for an app author to specify the function contents (without new generation overwriting). There is also the issue where each time a new version is added, internal will likely need to be updated, and then all conversion functions may need updates.

Another approach would be to have each version of the kind expose a Next/Previous function which converts to the next or previous version. Codegen challenges for ToInternal/FromInternal also exist here, but the functions don't need to be updated once written. However, this is markedly less efficient for kinds with many versions.

Other possible solutions should also be brainstormed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions