Skip to content

Support multiple GVKs per object in ingester controller #943

@badcount

Description

@badcount

Is your feature request related to a problem? Please describe.
scheme.ObjectKinds() can return multiple GVKs for a single Go type (e.g. a type registered under both v1 and v1beta1). The ingester controller currently always takes gvks[0] in SetupWithManager, handleDeletion, and handleDeletionAnnotation. This means only one GVK is ever used, which may be non-deterministic or incorrect when a type is registered under multiple versions.

Describe the solution you'd like
Decide on an explicit GVK selection strategy:

  • Prefer the storage version (hub version) — requires querying the API server or scheme for the storage version
  • Require exactly 1 GVK and return an error if multiple are found
  • Allow per-kind configuration of the preferred GVK

Describe alternatives you've considered
Keep the current gvks[0] behavior but add a warning log when multiple GVKs are returned, so the issue is visible without breaking existing functionality.

Additional context
Affected locations: SetupWithManager (controller name + For() registration), handleDeletion (TypeMeta for Delete call), handleDeletionAnnotation (TypeMeta for Delete call). Currently all three use gvks[0] without checking if multiple GVKs exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions