-
Notifications
You must be signed in to change notification settings - Fork 611
Description
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:
- User doesn't need to care about api versions when referencing to other resources, so definitely better UX
- Simpler upgrades when some api versions disappear (like Remove usage of eventing duck v1alpha1 shapes knative-extensions/eventing-kafka#426 (comment))
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)
- Alpha: Included in 0.24
- Add to
KReference
theGroup
field and implement the logic to resolve the api version. My idea is to add a method likeKReference.Resolve(crdLister)
that overwrites, if needed, theKReference.APIVersion
field with the served CRD version (similar to Subscription Channel ref without api version #5131): Add KReference.Group field and ResolveGroup function pkg#2127 - Support the
Group
field inside theSubscription.Spec.Subscriber
, adding thex-preserve-unknown-fields
to the CRD and the required code to implement it: ImplementKReference.Group
resolution forSubscriber.Ref
#5440 - User documentation
- Add to
- Beta graduation as soon as 1 release after the inception
- Beta:
- Support the new
KReference.Group
field in every place we use this type:- Enable in all the usages of Destination duck Now URIResolver can resolve KReference.Group pkg#2179
- Subscriber channel: Support
KReference.Group
inSubscription.Spec.Channel
#5520
- User documentation stabilization and improvements
- More e2e tests
- Add conformance tests
- Support the new
- Stable graduation as as soon as 2 releases after the Beta graduation
- Stable:
- Add the requirement to the spec
- Suggest in all documentation pages to use the new
Group
field more thanAPIVersion
Affected WG
- Eventing WG
Prior discussions
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status