Skip to content

Commit

Permalink
Pass the owner references to the data plane
Browse files Browse the repository at this point in the history
Signed-off-by: Calum Murray <[email protected]>
  • Loading branch information
Cali0707 committed Nov 22, 2023
1 parent f9f6197 commit b0a443a
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
8 changes: 5 additions & 3 deletions control-plane/pkg/reconciler/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,11 @@ func (r *Reconciler) reconcilerBrokerResource(ctx context.Context, topic string,
},
BootstrapServers: config.GetBootstrapServers(),
Reference: &contract.Reference{
Uuid: string(broker.GetUID()),
Namespace: broker.GetNamespace(),
Name: broker.GetName(),
Uuid: string(broker.GetUID()),
Namespace: broker.GetNamespace(),
Name: broker.GetName(),
Kind: "Broker",
GroupVersion: eventing.SchemeGroupVersion.String(),
},
}

Expand Down
8 changes: 5 additions & 3 deletions control-plane/pkg/reconciler/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,11 @@ func (r *Reconciler) getChannelContractResource(ctx context.Context, topic strin
},
BootstrapServers: config.GetBootstrapServers(),
Reference: &contract.Reference{
Uuid: string(channel.GetUID()),
Namespace: channel.GetNamespace(),
Name: channel.GetName(),
Uuid: string(channel.GetUID()),
Namespace: channel.GetNamespace(),
Name: channel.GetName(),
Kind: "KafkaChannel",
GroupVersion: messagingv1beta1.SchemeGroupVersion.String(),
},
}

Expand Down
8 changes: 5 additions & 3 deletions control-plane/pkg/reconciler/channel/v2/channelv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,11 @@ func (r *Reconciler) getChannelContractResource(ctx context.Context, topic strin
},
BootstrapServers: config.GetBootstrapServers(),
Reference: &contract.Reference{
Uuid: string(channel.GetUID()),
Namespace: channel.GetNamespace(),
Name: channel.GetName(),
Uuid: string(channel.GetUID()),
Namespace: channel.GetNamespace(),
Name: channel.GetName(),
Kind: "KafkaChannel",
GroupVersion: messagingv1beta1.SchemeGroupVersion.String(),
},
}

Expand Down
9 changes: 6 additions & 3 deletions control-plane/pkg/reconciler/sink/kafka_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"knative.dev/eventing-kafka-broker/control-plane/pkg/config"
"knative.dev/eventing-kafka-broker/control-plane/pkg/contract"

eventingv1alpha1 "knative.dev/eventing-kafka-broker/control-plane/pkg/apis/eventing/v1alpha1"
coreconfig "knative.dev/eventing-kafka-broker/control-plane/pkg/core/config"
"knative.dev/eventing-kafka-broker/control-plane/pkg/kafka"
kafkalogging "knative.dev/eventing-kafka-broker/control-plane/pkg/logging"
Expand Down Expand Up @@ -187,9 +188,11 @@ func (r *Reconciler) reconcileKind(ctx context.Context, ks *eventing.KafkaSink)
},
BootstrapServers: kafka.BootstrapServersCommaSeparated(ks.Spec.BootstrapServers),
Reference: &contract.Reference{
Uuid: string(ks.GetUID()),
Namespace: ks.GetNamespace(),
Name: ks.GetName(),
Uuid: string(ks.GetUID()),
Namespace: ks.GetNamespace(),
Name: ks.GetName(),
Kind: "KafkaSink",
GroupVersion: eventingv1alpha1.SchemeGroupVersion.String(),
},
}
if ks.Spec.HasAuthConfig() {
Expand Down
8 changes: 5 additions & 3 deletions control-plane/pkg/reconciler/testing/objects_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,11 @@ func brokerAddressable(broker *eventing.Broker, serviceName, serviceNamespace st

func BrokerReference() *contract.Reference {
return &contract.Reference{
Uuid: BrokerUUID,
Namespace: BrokerNamespace,
Name: BrokerName,
Uuid: BrokerUUID,
Namespace: BrokerNamespace,
Name: BrokerName,
Kind: "Broker",
GroupVersion: eventing.SchemeGroupVersion.String(),
}
}

Expand Down
8 changes: 5 additions & 3 deletions control-plane/pkg/reconciler/testing/objects_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,11 @@ func WithChannelTopicStatusAnnotation(topicName string) func(obj duckv1.KRShaped

func ChannelReference() *contract.Reference {
return &contract.Reference{
Uuid: ChannelUUID,
Namespace: ChannelNamespace,
Name: ChannelName,
Uuid: ChannelUUID,
Namespace: ChannelNamespace,
Name: ChannelName,
Kind: "KafkaChannel",
GroupVersion: messagingv1beta1.SchemeGroupVersion.String(),
}
}

Expand Down
8 changes: 5 additions & 3 deletions control-plane/pkg/reconciler/testing/objects_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ func SinkAddressable(configs *config.Env) func(obj duckv1.KRShaped) {

func SinkReference() *contract.Reference {
return &contract.Reference{
Uuid: SinkUUID,
Namespace: SinkNamespace,
Name: SinkName,
Uuid: SinkUUID,
Namespace: SinkNamespace,
Name: SinkName,
Kind: "KafkaSink",
GroupVersion: eventing.SchemeGroupVersion.String(),
}
}

Expand Down

0 comments on commit b0a443a

Please sign in to comment.