Skip to content

Commit

Permalink
KafkaChannel hack
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
  • Loading branch information
slinkydeveloper committed Mar 17, 2021
1 parent b2ea385 commit 11bfab0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/reconciler/subscription/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,12 @@ func (r *Reconciler) trackAndFetchChannel(ctx context.Context, sub *v1.Subscript
func (r *Reconciler) getChannel(ctx context.Context, sub *v1.Subscription) (*eventingduckv1.Channelable, pkgreconciler.Event) {
logging.FromContext(ctx).Infow("Getting channel", zap.Any("channel", sub.Spec.Channel))

// HACK if a channel ref is a kafka channel ref, we need to hack it around to use only v1beta1
// TODO REMOVE AFTER 0.22 release
if sub.Spec.Channel.Kind == "KafkaChannel" && sub.Spec.Channel.APIVersion == "messaging.knative.dev/v1alpha1" {
sub.Spec.Channel.APIVersion = "messaging.knative.dev/v1beta1"
}

// 1. Track the channel pointed by subscription.
// a. If channel is a Channel.messaging.knative.dev
obj, err := r.trackAndFetchChannel(ctx, sub, sub.Spec.Channel)
Expand Down

0 comments on commit 11bfab0

Please sign in to comment.