Skip to content

Commit

Permalink
Fix channel finalizer logic (knative-extensions#3295)
Browse files Browse the repository at this point in the history
Signed-off-by: Calum Murray <cmurray@redhat.com>
  • Loading branch information
Cali0707 authored and matzew committed Aug 29, 2023
1 parent 20fff98 commit 59e807a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion control-plane/pkg/reconciler/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ const (
// TopicPrefix is the Kafka Channel topic prefix - (topic name: knative-messaging-kafka.<channel-namespace>.<channel-name>).
DefaultDeliveryOrder = contract.DeliveryOrder_ORDERED
NewChannelIngressServiceName = "kafka-channel-ingress"
// TopicPrefix is the old Kafka Channel topic prefix - we keep this constant so that deleting channels shortly after upgrading
// does not have issues. See https://github.com/knative-extensions/eventing-kafka-broker/issues/3289 for more info
TopicPrefix = "knative-messaging-kafka"
)

type Reconciler struct {
Expand Down Expand Up @@ -449,7 +452,7 @@ func (r *Reconciler) finalizeKind(ctx context.Context, channel *messagingv1beta1

topicName, ok := channel.Status.Annotations[kafka.TopicAnnotation]
if !ok {
return fmt.Errorf("no topic annotated on channel")
topicName = kafka.ChannelTopic(TopicPrefix, channel)
}
topic, err := kafka.DeleteTopic(kafkaClusterAdminClient, topicName)
if err != nil {
Expand Down

0 comments on commit 59e807a

Please sign in to comment.