Skip to content

Set (cluster)bus.Kind ourselves #418

Closed
greghaynes wants to merge 1 commit into
knative:masterfrom
greghaynes:fix/bus-update-reconciler
Closed

Set (cluster)bus.Kind ourselves #418
greghaynes wants to merge 1 commit into
knative:masterfrom
greghaynes:fix/bus-update-reconciler

Conversation

@greghaynes
Copy link
Copy Markdown
Contributor

@greghaynes greghaynes commented Sep 6, 2018

Proposed Changes

This property is not set in the new version of a bus when UpdateFunc is
called from an informer.

Fixes #417

Release Note

NONE

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: greghaynes
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: evankanderson

If they are not already assigned, you can assign the PR to them by writing /assign @evankanderson in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 6, 2018
Comment thread pkg/buses/reconciler.go Outdated
func (r *Reconciler) createOrUpdateBus(bus *channelsv1alpha1.Bus) error {
if r.bus.GetObjectKind().GroupVersionKind().Kind != bus.Kind ||
bus.Namespace != r.bus.GetObjectMeta().GetNamespace() ||
if bus.Namespace != r.bus.GetObjectMeta().GetNamespace() ||
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.

the Kind needs to be checked because r.bus is a GenericBus and may not be a Bus. See #298

@greghaynes greghaynes force-pushed the fix/bus-update-reconciler branch from 7e37545 to 9673572 Compare September 6, 2018 21:28
This property is not set in the new version of a bus when UpdateFunc is
called from an informer.

Fixes knative#417
@greghaynes greghaynes force-pushed the fix/bus-update-reconciler branch from 9673572 to 0fb7ef9 Compare September 6, 2018 21:29
@greghaynes greghaynes changed the title Dont short circuit bus update based on bus.kind Set (cluster)bus.Kind ourselves Sep 6, 2018
Comment thread pkg/buses/reconciler.go
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.

scothis added a commit to scothis/eventing that referenced this pull request Sep 7, 2018
- only start the needed informer for either Bus or ClusterBus, we don't
  need both
- consolidate the createOrUpdateBus and createOrUpdateClusterBus methods
- use BusReference to check if the updated bus is the reconciled bus

Refs knative#418
@scothis
Copy link
Copy Markdown
Contributor

scothis commented Sep 7, 2018

I'm generally 👍 on this PR as it unblocks meaningful bus updates. I attempted to resolve the root issue with #420.

@greghaynes
Copy link
Copy Markdown
Contributor Author

I'm fine waiting for #420 as its a much nicer fix.

@greghaynes greghaynes closed this Sep 10, 2018
knative-prow-robot pushed a commit that referenced this pull request Sep 11, 2018
* Cleanup Bus/ClusterBus reconciler

- only start the needed informer for either Bus or ClusterBus, we don't
  need both
- consolidate the createOrUpdateBus and createOrUpdateClusterBus methods
- use BusReference to check if the updated bus is the reconciled bus

Refs #418

* Remove redudant BusReference passed to Reconciler#Run()

* Create copy of Bus before calling createOrUpdateBus

* Review feedback

* Clarify that the workqueue key is
matzew added a commit to matzew/eventing that referenced this pull request Feb 4, 2020
pierDipi pushed a commit to pierDipi/eventing that referenced this pull request Nov 17, 2023
Also make sure that a dead letter sink is resolved for channel before
the source actually sends the event (moving this check from Requirement
phase to Setup).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants