knative / eventing

Event-driven application platform for Kubernetes
https://knative.dev/docs/eventing
Apache License 2.0
1.4k stars 586 forks source link

Add webhook for `EventPolicy` #7972

Open creydr opened 1 month ago

creydr commented 1 month ago

We need to add a webhook for EventPolicies, with at least the following validations for EventPolicies:

Prerequisites:

Additional context:

Additional hints for new contributors before starting with this issue:

  1. When the issue has the Draft status, the issue is subject to change and thus should not be started to be worked on
  2. Make sure you've read and understood the CONTRIBUTING.md guidelines
  3. Make sure you're able to run Knative Eventing locally and run at least the unit tests.
  4. When you feel comfortable with this issue, feel free to assign it to you (e.g. by commenting /assign). Please be aware that we might unassign you, if we don't see any progress from your side to give other contributors also a chance to work on this issue.
  5. Feel free to raise any questions you have either directly here in the issue, in the #knative-eventing Slack channel or join the Eventing Workgroup Meeting
pierDipi commented 1 month ago

EventPolicySpecTo must only contain either a Ref or a Selector. Not both at the same time

I did (perhaps wrongly) include this validation logic in this PR: https://github.com/knative/eventing/pull/7995

dharmjit commented 1 month ago

Hi @creydr @pierDipi , If okay, I can take this up.

creydr commented 1 month ago

Hey @dharmjit, would be great, if you could work on this. The other required issue (#7974) should be done soon the the PR merge (I just lgtm'ed it).

/assign @dharmjit

creydr commented 1 month ago

Hey @dharmjit, as the prerequisite issues are resolved, this should be ready to be worked on (moved from "Backlog" to "Ready").

rahulii commented 1 month ago

Hey @dharmjit , let me know if you don't have sufficient bandwidth so that I can take this up while you are working on the reconciler part (which itself is a big part) Thanks!

Leo6Leo commented 1 week ago

@dharmjit are there anything I can help you with?

If you're still working on this issue, please let me know within the next 24 hours. We understand that plans and priorities can change, and if you're no longer able to continue with this task, that's completely okay! In case I don't hear back from you in the next 24 hours, I'll reassign the issue to @rahulii to ensure our workflow continues smoothly.

dharmjit commented 1 week ago

@Leo6Leo Apologies, I got caught up in some stuff. I will try to pick this up tomorrow and submit a PR.