-
Notifications
You must be signed in to change notification settings - Fork 618
Fix MT Channel based broker when OIDC is enabled #8727
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
Fix MT Channel based broker when OIDC is enabled #8727
Conversation
|
Welcome @twoGiants! It looks like this is your first PR to knative/eventing 🎉 |
|
Hi @twoGiants. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
I think it works with So wondering why than not when TLS is disabled (which is not recommended) |
|
/ok-to-test |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8727 +/- ##
==========================================
- Coverage 50.22% 50.19% -0.03%
==========================================
Files 409 409
Lines 26659 26662 +3
==========================================
- Hits 13390 13384 -6
- Misses 12430 12436 +6
- Partials 839 842 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I think I mentioned it in our call but just to have it also documented here. The reason is that the in-memory channel dispatcher creates two handlers => httpHandler and httpsHandler. And the |
@twoGiants this seems likely to be the problem to me - why are we switching the parsing for this case in particular? |
I think the switch comes as we might setup two servers: one for http (which uses the host based name detection) and one for https (which uses the path based name detection) (see #6865). |
Yeah and to add to @creydr answer => we don't have the full path in the request when the |
7738606 to
359a598
Compare
f9b0614 to
d470fb3
Compare
|
/ok-to-test |
When OIDC is enabled and https is disabled (i.e. http requests are used) the event receiver is using the host name to determine the name of the channel and fails to do so. An example host name is `broker-kne-trigger-kn-channel.namespace-1.svc.cluster.local`. The channel name here is `broker-kne-trigger` without the suffix `-kn-channel` which was hardcoded in the logic which was creating the channel owned k8 service. The constant `-kn-channel` is now extracted into a common constant in the `channel` package. A conditional check in `ParseChannelFromHost` now checks for the suffix in the host name and removes it if needed. An additional test case was added and existing tests were updated. Issue knative#8705. Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
d470fb3 to
e502127
Compare
|
/test reconciler-tests |
creydr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing it @twoGiants
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: creydr, twoGiants The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
infra issue... |
unrelated (flake) |
|
/cherry-pick release-1.18 |
|
@twoGiants: #8727 failed to apply on top of branch "release-1.18": DetailsIn response to this:
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-sigs/prow repository. |
|
/cherry-pick release-1.19 |
|
@twoGiants: new pull request created: #8777 DetailsIn response to this:
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-sigs/prow repository. |
When OIDC is enabled and https is disabled (i.e. http requests are used) the event receiver is using the host name to determine the name of the channel and fails to do so. An example host name is
broker-kne-trigger-kn-channel.namespace-1.svc.cluster.local. The channel name here isbroker-kne-triggerwithout the suffix-kn-channelwhich was hardcoded in the logic which was creating the channel owned k8 service.The constant
-kn-channelis now extracted into a common constant in thechannelpackage. A conditional check inParseChannelFromHostnow checks for the suffix in the host name and removes it if needed.An additional test case was added and existing tests were updated.
🐛 Fixes #8705.
Proposed Changes
Pre-review Checklist
Release Note
Docs
Now the authorization example in the docs is actually working with TLS disabled and OIDC enabled: https://knative.dev/docs/eventing/features/authorization/#example