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

Allow kafka-controller to list JobSinks #4155

Merged

Conversation

mgencur
Copy link
Contributor

@mgencur mgencur commented Nov 1, 2024

This is required otherwise KafkaBroker and KafkaSource can't forward events to JobSink. This type of error is thrown on Kafka Broker status:

failed to reconcile contract: failed to reconcile egress: failed to resolve subscriber: failed to get lister for sinks.knative.dev/v1alpha1, Resource=jobsinks: jobsinks.sinks.knative.dev is forbidden: User "system:serviceaccount:knative-eventing:kafka-controller" cannot list resource "jobsinks" in API group "sinks.knative.dev" at the cluster scope

I have also created a test for KafkaBroker forwarding events to JobSink to verify the fix. But it's probably not necessary to include it. Anyway, it's available here: mgencur@57dbb53

Fixes #

Proposed Changes

Release Note


Docs

This is required otherwise KafkaBroker and KafkaSource can't forward
events to JobSink. This type of error is thrown:

failed to reconcile contract: failed to reconcile egress: failed to
resolve subscriber: failed to get lister for sinks.knative.dev/v1alpha1,
Resource=jobsinks: jobsinks.sinks.knative.dev is forbidden: User
"system:serviceaccount:knative-eventing:kafka-controller" cannot list
resource "jobsinks" in API group "sinks.knative.dev" at the cluster
scope
@knative-prow knative-prow bot requested a review from matzew November 1, 2024 10:27
@knative-prow knative-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 1, 2024
@knative-prow knative-prow bot requested a review from pierDipi November 1, 2024 10:27
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.51%. Comparing base (aec2555) to head (712942d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4155   +/-   ##
=======================================
  Coverage   45.51%   45.51%           
=======================================
  Files         270      270           
  Lines       19925    19925           
=======================================
  Hits         9069     9069           
  Misses      10129    10129           
  Partials      727      727           

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

@mgencur
Copy link
Contributor Author

mgencur commented Nov 1, 2024

/retest-required

@pierDipi
Copy link
Member

pierDipi commented Nov 4, 2024

@mgencur I think the best fix would be to add jobsink to the addressable resolver aggregation in the core resources: https://github.com/knative/eventing/blob/main/config/core/roles/addressable-resolvers-clusterrole.yaml, that has the benefit that all controllers will get access to it for resolving the address

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

I'll merge this one anyway, but I'd add the permissions there so that other controllers work too

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2024
Copy link

knative-prow bot commented Nov 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mgencur, 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 knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2024
@knative-prow knative-prow bot merged commit 1616ec3 into knative-extensions:main Nov 4, 2024
32 of 33 checks passed
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants