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 EventPolicy Reconciler #8024

Merged
merged 6 commits into from
Jun 28, 2024

Conversation

dharmjit
Copy link
Contributor

Fixes #7973

Proposed Changes

  • 🎁 Add Reconciler for EventPolicy CRD which primarily
    • Resolves the identities of .spec.from[].refs and populates them in its status, so the oidc identity of a ref can be seen directly.
    • Sets the EventPolicy to Ready / NotReady (e.g. if an identity from a ref could not be resolved)

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note

Add EventPolicy Reconciler

Docs

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 24, 2024
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2024
Copy link

knative-prow bot commented Jun 24, 2024

Welcome @dharmjit! It looks like this is your first PR to knative/eventing 🎉

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 24, 2024
Copy link

knative-prow bot commented Jun 24, 2024

Hi @dharmjit. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

Signed-off-by: Dharmjit Singh <sdharmjit@vmware.com>
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2024
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
@dharmjit dharmjit marked this pull request as ready for review June 25, 2024 10:18
@knative-prow knative-prow bot requested a review from creydr June 25, 2024 10:18
@dharmjit dharmjit changed the title [WIP] Add EventPolicy Reconciler Add EventPolicy Reconciler Jun 25, 2024
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 25, 2024
Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your work so far on this @dharmjit !

pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy_test.go Outdated Show resolved Hide resolved
@creydr
Copy link
Member

creydr commented Jun 25, 2024

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 25, 2024
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 5 lines in your changes missing coverage. Please review.

Project coverage is 67.89%. Comparing base (d4e647d) to head (f8edaeb).
Report is 8 commits behind head on main.

Files Patch % Lines
...kg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go 75.00% 4 Missing ⚠️
cmd/controller/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8024      +/-   ##
==========================================
+ Coverage   67.70%   67.89%   +0.19%     
==========================================
  Files         364      366       +2     
  Lines       17042    17115      +73     
==========================================
+ Hits        11538    11621      +83     
+ Misses       4783     4773      -10     
  Partials      721      721              

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

@dharmjit
Copy link
Contributor Author

/ok-to-test

Signed-off-by: Dharmjit Singh <sdharmjit@vmware.com>
@dharmjit
Copy link
Contributor Author

/ok-to-test

pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go Outdated Show resolved Hide resolved
pkg/reconciler/testing/v1/eventpolicy.go Show resolved Hide resolved
pkg/reconciler/testing/v1/listers.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
Signed-off-by: Dharmjit Singh <sdharmjit@vmware.com>
@knative-prow knative-prow bot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 27, 2024
@knative-prow knative-prow bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 27, 2024
Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

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

In general looking really good @dharmjit!
Left some nits (mostly about naming or typos)

pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go Outdated Show resolved Hide resolved
pkg/reconciler/eventpolicy/eventpolicy.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go Outdated Show resolved Hide resolved
pkg/reconciler/testing/v1/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/testing/v1/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/testing/v1/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/testing/v1/eventpolicy.go Outdated Show resolved Hide resolved
pkg/reconciler/testing/v1/eventpolicy.go Outdated Show resolved Hide resolved
Signed-off-by: Dharmjit Singh <sdharmjit@vmware.com>
Signed-off-by: Dharmjit Singh <sdharmjit@vmware.com>
Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your work and cycles on this! 💪

/lgtm
/approve

🎉

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

knative-prow bot commented Jun 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, dharmjit

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 Jun 28, 2024
@creydr
Copy link
Member

creydr commented Jun 28, 2024

/test conformance-tests

@creydr
Copy link
Member

creydr commented Jun 28, 2024

/test reconciler-tests

@knative-prow knative-prow bot merged commit beb71be into knative:main Jun 28, 2024
35 of 36 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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add reconciler for EventPolicy
4 participants