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

Reconcile trigger on OIDC service account changes only, if SA references a trigger for correct broker class #7849

Conversation

creydr
Copy link
Member

@creydr creydr commented Apr 22, 2024

Currently we reconcile Triggers when a OIDC service account changes. This is also done, when the OIDC service account is from a Trigger for a different broker class.
This PR addresses it and adds a filter function to reconcile Triggers on OIDC SA changes only, if the SA is owned by a Trigger for the MTChannelBasedBroker broker class.

@knative-prow knative-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 22, 2024
@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 22, 2024
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 69.54%. Comparing base (7e1c082) to head (0c25216).
Report is 18 commits behind head on main.

Files Patch % Lines
pkg/reconciler/broker/trigger/controller.go 62.50% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7849      +/-   ##
==========================================
+ Coverage   69.22%   69.54%   +0.32%     
==========================================
  Files         339      340       +1     
  Lines       19494    15741    -3753     
==========================================
- Hits        13494    10947    -2547     
+ Misses       5337     4124    -1213     
- Partials      663      670       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@creydr
Copy link
Member Author

creydr commented Apr 22, 2024

/test reconciler-tests

1 similar comment
@creydr
Copy link
Member Author

creydr commented Apr 22, 2024

/test reconciler-tests

@creydr
Copy link
Member Author

creydr commented Apr 22, 2024

seems CI is having a bad day:
the server is currently unable to handle the request

/test reconciler-tests

@creydr
Copy link
Member Author

creydr commented Apr 22, 2024

/retest-required

Copy link
Member

@pierDipi pierDipi 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 knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2024
Copy link

knative-prow bot commented Apr 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, 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

@creydr
Copy link
Member Author

creydr commented Apr 23, 2024

/test reconciler-tests

@creydr
Copy link
Member Author

creydr commented Apr 23, 2024

/cherry-pick release-1.13

@knative-prow-robot
Copy link
Contributor

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

In response to this:

/cherry-pick release-1.13

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 knative-prow bot merged commit e23ebab into knative:main Apr 23, 2024
33 of 38 checks passed
@knative-prow-robot
Copy link
Contributor

@creydr: #7849 failed to apply on top of branch "release-1.13":

Applying: Reconcile trigger on OIDC service account changes only, if SA references a trigger for correct broker class
Using index info to reconstruct a base tree...
M	pkg/reconciler/broker/trigger/controller.go
M	pkg/reconciler/broker/trigger/controller_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/reconciler/broker/trigger/controller_test.go
CONFLICT (content): Merge conflict in pkg/reconciler/broker/trigger/controller_test.go
Auto-merging pkg/reconciler/broker/trigger/controller.go
CONFLICT (content): Merge conflict in pkg/reconciler/broker/trigger/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 Reconcile trigger on OIDC service account changes only, if SA references a trigger for correct broker class
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.13

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.

creydr added a commit to creydr/knative-eventing that referenced this pull request Apr 24, 2024
…ces a trigger for correct broker class (knative#7849)

* Reconcile trigger on OIDC service account changes only, if SA references a trigger for correct broker class

* Run goimports and gofmt

* Remove deprecated use of pointer.Bool(v) and switch to prt.Bool(v)
openshift-merge-bot bot pushed a commit to openshift-knative/eventing that referenced this pull request Apr 24, 2024
…y, if SA references a trigger for correct broker class (#592)

* Use filtered informer to watch OIDC service accounts (knative#7527)

* controller.go changed

* knative#7320 WIP

* WIP: Testing filtered informer (knative#7341)

* unit test passed

* Revert "Merge remote-tracking branch 'otherfork/main' into main"

This reverts commit 94cd51b, reversing
changes made to 0bf2982.

* Removed comments

* Changed to filtered informer for Subscription identity service account

* Changed to filtered informer for Sequence service accounts

* Changed to filtered informer for Parallel identity service accounts

* Changed to filtered informer for APIServerSource identity service account

* fixed unit tests

* added label selector for mtchannel_broker

* added filtered informer for sinkbinding identity service accounts

* added OIDC label selector in webhook

* added filtered informer for containersource  service accounts

* added filtered informer for pingsource service accounts

* added OIDC label selector in apiserver ctx

* added OIDC label selector in broker/filter

* added OIDC label selector in broker/ingress

* added OIDC label selector in in_memory/channel_dispatcher

* added OIDC label selector in mtping

* fixed unit test issues for pingsource

* fixed unit test for container source

* formatted files

* updated service account informer in apiserversource

* updated service account informers in other places

* small typo fix

* added actual value for OIDC label

* added a valid value for OIDClabelkey

* changed references of OIDCLabelKey

* fixed import path problem

* changed OIDCLabelSelector in all main.go files

* changed instances of OIDCLabelSelector in controller and controller test files

* deleted OIDC related labels from register.go

* fixed formatting issues

* Added value for OIDCLabelKey

---------

Co-authored-by: Scott <scottprotoss@gmail.com>

* Reconcile trigger on OIDC service account changes only, if SA references a trigger for correct broker class (knative#7849)

* Reconcile trigger on OIDC service account changes only, if SA references a trigger for correct broker class

* Run goimports and gofmt

* Remove deprecated use of pointer.Bool(v) and switch to prt.Bool(v)

---------

Co-authored-by: Yijie Wang <147119743+yijie-04@users.noreply.github.com>
Co-authored-by: Scott <scottprotoss@gmail.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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants