这是indexloc提供的服务,不要输入任何密码
Skip to content

[Experimental] KReference.Group to avoid being explicit on the APIVersion #5086

@slinkydeveloper

Description

@slinkydeveloper

Description
I propose to add a new field to KReference, called Group. For example, in order to refer to a KafkaChannel, more than using this one:

Spec:
  Channel:
    API Version:  messaging.knative.dev/v1alpha1
    Kind:         KafkaChannel
    Name:         testchannel

The user will be able to just use this:

Spec:
  Channel:
    Group:  messaging.knative.dev
    Kind:         KafkaChannel
    Name:         testchannel

This approach brings the following benefits:

When the api version is needed, an algorithm can just retrieve the latest for the provided api group and kind and then query the api server using such version.

Background
This came out while working on the KafkaChannel v1alpha1 removal: knative-extensions/eventing-kafka#426 (comment). This upgrade ended up being quite painful and we even got it wrong with brokers knative-extensions/eventing-kafka#624.

Not tieing to the api version seems to me logically more correct, because the api version is a detail of the resource. With the reference system we have today, every time we need to remove an old api, we'll have to ask users to accept some downtime to fix the api version manually, or we need to end up with hacks like https://github.com/knative/eventing/pull/5085/files#diff-74513e8fb938944cdb1b786c568c843a282eecd46ba5440a4374763245e2ffeaR30. Both are in my opinion unacceptable.

Exit Criteria
Users are now able to use references without explicitly define the api version, but just using the api group.

Experimental flag name: kreference-group

Experimental feature stages plan

Below the proposed plan for the feature stages (this list implicitly includes the requirements defined in the process)

Affected WG

  • Eventing WG

Prior discussions

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.roadmapIssues for linking from the roadmaptriage/acceptedIssues which should be fixed (post-triage)

    Type

    No type

    Projects

    Status

    Ready To Work

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions