Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add promote filter function to Broker and Trigger reconciler #1616

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Dec 15, 2021

When a reconciler gets promoted to be the leader, every object
gets re-queued even if it shouldn't be.

Tested in #1612

Proposed Changes

  • Add promote filter function to Broker and Trigger reconciler

Release Note

None

Docs

None

When a reconciler gets promoted to be the leader, every object
gets re-queued even if it shouldn't be.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
@knative-prow-robot knative-prow-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/control-plane approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 15, 2021
@pierDipi
Copy link
Member Author

/cherry-pick release-1.1

@knative-prow-robot
Copy link
Contributor

@pierDipi: once the present PR merges, I will cherry-pick it on top of release-1.1 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@pierDipi
Copy link
Member Author

/cherry-pick release-1.0

@knative-prow-robot
Copy link
Contributor

@pierDipi: once the present PR merges, I will cherry-pick it on top of release-1.0 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@pierDipi
Copy link
Member Author

/cherry-pick release-0.26

@knative-prow-robot
Copy link
Contributor

@pierDipi: once the present PR merges, I will cherry-pick it on top of release-0.26 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.26

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-sandbox-eventing-kafka-broker-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
control-plane/pkg/reconciler/broker/controller.go 85.2% 85.7% 0.5

@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #1616 (6da1be0) into main (2e8d011) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1616      +/-   ##
============================================
+ Coverage     73.12%   73.14%   +0.02%     
  Complexity      597      597              
============================================
  Files           118      118              
  Lines          4375     4379       +4     
  Branches        171      171              
============================================
+ Hits           3199     3203       +4     
  Misses          911      911              
  Partials        265      265              
Flag Coverage Δ
java-unittests 81.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
control-plane/pkg/reconciler/broker/controller.go 79.68% <100.00%> (+0.65%) ⬆️
control-plane/pkg/reconciler/trigger/controller.go 85.29% <100.00%> (+0.21%) ⬆️
...ol-plane/pkg/reconciler/trigger/v2/controllerv2.go 50.90% <100.00%> (+0.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e8d011...6da1be0. Read the comment docs.

@@ -83,7 +83,9 @@ func NewController(ctx context.Context, watcher configmap.Watcher, env *config.E
)
}

impl := brokerreconciler.NewImpl(ctx, reconciler, kafka.BrokerClass)
impl := brokerreconciler.NewImpl(ctx, reconciler, kafka.BrokerClass, func(impl *controller.Impl) controller.Options {
return controller.Options{PromoteFilterFunc: kafka.BrokerClassFilter()}
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

Copy link
Contributor

@matzew matzew left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 15, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew, pierDipi

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

The pull request process is described here

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
Copy link
Contributor

@pierDipi: new pull request created: #1617

In response to this:

/cherry-pick release-1.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

@pierDipi: #1616 failed to apply on top of branch "release-1.0":

Applying: Add promote filter function to Broker and Trigger reconciler
Using index info to reconstruct a base tree...
M	control-plane/pkg/reconciler/broker/controller.go
M	control-plane/pkg/reconciler/trigger/controller.go
A	control-plane/pkg/reconciler/trigger/v2/controllerv2.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): control-plane/pkg/reconciler/trigger/v2/controllerv2.go deleted in HEAD and modified in Add promote filter function to Broker and Trigger reconciler. Version Add promote filter function to Broker and Trigger reconciler of control-plane/pkg/reconciler/trigger/v2/controllerv2.go left in tree.
Auto-merging control-plane/pkg/reconciler/trigger/controller.go
Auto-merging control-plane/pkg/reconciler/broker/controller.go
CONFLICT (content): Merge conflict in control-plane/pkg/reconciler/broker/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add promote filter function to Broker and Trigger reconciler
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

@pierDipi: #1616 failed to apply on top of branch "release-0.26":

Applying: Add promote filter function to Broker and Trigger reconciler
Using index info to reconstruct a base tree...
M	control-plane/pkg/reconciler/broker/controller.go
M	control-plane/pkg/reconciler/trigger/controller.go
A	control-plane/pkg/reconciler/trigger/v2/controllerv2.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): control-plane/pkg/reconciler/trigger/v2/controllerv2.go deleted in HEAD and modified in Add promote filter function to Broker and Trigger reconciler. Version Add promote filter function to Broker and Trigger reconciler of control-plane/pkg/reconciler/trigger/v2/controllerv2.go left in tree.
Auto-merging control-plane/pkg/reconciler/trigger/controller.go
Auto-merging control-plane/pkg/reconciler/broker/controller.go
CONFLICT (content): Merge conflict in control-plane/pkg/reconciler/broker/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add promote filter function to Broker and Trigger reconciler
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-0.26

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@pierDipi pierDipi deleted the SRVKE-1087_Add-promote-filter-function branch December 15, 2021 19:24
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this pull request Dec 16, 2021
…-extensions#1616)

When a reconciler gets promoted to be the leader, every object
gets re-queued even if it shouldn't be.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
knative-prow-robot pushed a commit that referenced this pull request Dec 16, 2021
…1621)

When a reconciler gets promoted to be the leader, every object
gets re-queued even if it shouldn't be.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this pull request Dec 22, 2021
…-extensions#1616) (knative-extensions#1621)

When a reconciler gets promoted to be the leader, every object
gets re-queued even if it shouldn't be.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
openshift-merge-robot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request Dec 23, 2021
…-extensions#1616) (knative-extensions#1621) (#68)

When a reconciler gets promoted to be the leader, every object
gets re-queued even if it shouldn't be.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this pull request Aug 5, 2024
…-extensions#1616)

When a reconciler gets promoted to be the leader, every object
gets re-queued even if it shouldn't be.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane lgtm Indicates that a PR is ready to be merged. 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.

4 participants