Subscription.Spec.Channel
should use KReference
instead of corev1.ObjectReference
#5411
Labels
kind/bug
Categorizes issue or PR as related to a bug.
Describe the bug
Subscription.Spec.Channel
usescorev1.ObjectReference
, which has fields we don't need, and we don't support. Per documentation:eventing/pkg/apis/messaging/v1/subscription_types.go
Lines 76 to 92 in 0653ac4
Also the CRD definition is wrong, because the schema contains those fields we don't support in that definition:
https://github.com/knative/eventing/blob/main/config/core/resources/subscription.yaml#L37-L61
We then perform the validation properly, with some custom logic:
eventing/pkg/apis/messaging/v1/subscribable_channelable_validation.go
Line 62 in 0653ac4
But still it doesn't make sense the "bigger type", to have the fields disabled. Neither it makes sense to have those fields documented in the CRD, if then they are disallowed.
Expected behavior
We should use
KReference
which contains just the fields we can support for theChannel
field. We also need to trim the CRD schema to just the allowed fields.Knative release version
all
Additional context
This was discovered while planning #5086. Because of that type, we can't even further extend the behaviour of that particular field.
The text was updated successfully, but these errors were encountered: