Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/buses/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ func (r *Reconciler) syncBus(namespace string, name string) error {
return err
}

// TODO: Figure out why kind is set to nil on updates but not on create
bus.Kind = busKind

// Sync the Bus
err = r.createOrUpdateBus(bus)
if err != nil {
Expand All @@ -469,6 +472,9 @@ func (r *Reconciler) syncClusterBus(name string) error {
return err
}

// TODO: Figure out why kind is set to nil on updates but not on create
clusterBus.Kind = clusterBusKind

// Sync the ClusterBus
err = r.createOrUpdateClusterBus(clusterBus)
if err != nil {
Expand Down Expand Up @@ -535,6 +541,7 @@ func (r *Reconciler) createOrUpdateBus(bus *channelsv1alpha1.Bus) error {
bus.Namespace != r.bus.GetObjectMeta().GetNamespace() ||
bus.Name != r.bus.GetObjectMeta().GetName() {
// this is not our bus
r.logger.Infof("Ignoring update for bus (%v/%v) that is not ours.", bus.Namespace, bus.Name)
return nil
}

Expand All @@ -554,6 +561,7 @@ func (r *Reconciler) createOrUpdateClusterBus(clusterBus *channelsv1alpha1.Clust
if r.bus.GetObjectKind().GroupVersionKind().Kind != clusterBus.Kind ||
clusterBus.Name != r.bus.GetObjectMeta().GetName() {
// this is not our clusterbus
r.logger.Infof("Ignoring update for bus (%v/%v) that is not ours.", clusterBus.Namespace, clusterBus.Name)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClusterBuses don't have a namespace.

I've been trying to normalize logging references to resources by using the respective reference.

%s is more idiomatic for string values.

return nil
}

Expand Down