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

feat: add syncset controller, feat: syncset readiness #3030

Merged
merged 47 commits into from
Nov 23, 2023

Conversation

acpana
Copy link
Contributor

@acpana acpana commented Oct 3, 2023

in support of the sync set proposal

  • Adds a syncset_controller and necessary changes for tracking readiness from syncsets and config resources
  • Introduces a reconciler for data expectations
  • Implements "TryCancel" for data expectations
  • Improves the CacheManager to distinguish the watch errors for the gvks it's given
  • Adds the SyncSet CRD to the manifest.

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

Added comments, have not reviewed tests.

pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/controller/config/config_controller.go Outdated Show resolved Hide resolved
pkg/controller/syncset/syncset_controller.go Outdated Show resolved Hide resolved
pkg/controller/syncset/syncset_controller.go Outdated Show resolved Hide resolved
pkg/controller/syncset/syncset_controller.go Outdated Show resolved Hide resolved
pkg/readiness/object_tracker.go Outdated Show resolved Hide resolved
pkg/readiness/object_tracker.go Outdated Show resolved Hide resolved
pkg/readiness/ready_tracker.go Outdated Show resolved Hide resolved
pkg/readiness/ready_tracker.go Show resolved Hide resolved
pkg/readiness/ready_tracker.go Show resolved Hide resolved
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
plus naming, style, etc

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2023

Codecov Report

Attention: 126 lines in your changes are missing coverage. Please review.

Comparison is base (aed792f) 53.21% compared to head (430deea) 53.78%.

Files Patch % Lines
pkg/controller/syncset/syncset_controller.go 46.47% 31 Missing and 7 partials ⚠️
pkg/readiness/ready_tracker.go 74.46% 30 Missing and 6 partials ⚠️
pkg/cachemanager/cachemanager.go 76.62% 15 Missing and 3 partials ⚠️
pkg/readiness/pruner/pruner.go 65.51% 9 Missing and 1 partial ⚠️
pkg/cachemanager/aggregator/aggregator.go 50.00% 6 Missing and 1 partial ⚠️
pkg/watch/errorlist.go 81.57% 7 Missing ⚠️
pkg/watch/set.go 0.00% 5 Missing ⚠️
pkg/watch/manager.go 25.00% 2 Missing and 1 partial ⚠️
pkg/controller/config/config_controller.go 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3030      +/-   ##
==========================================
+ Coverage   53.21%   53.78%   +0.56%     
==========================================
  Files         134      136       +2     
  Lines       11917    12198     +281     
==========================================
+ Hits         6342     6561     +219     
- Misses       5080     5136      +56     
- Partials      495      501       +6     
Flag Coverage Δ
unittests 53.78% <70.42%> (+0.56%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@acpana acpana requested a review from maxsmythe October 6, 2023 18:08
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
- rework interpretErr to return failing gvks
- implement TryCancel for trackerMap

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana marked this pull request as ready for review October 9, 2023 23:46
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

Getting closer!

Have not reviewed tests.

pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/controller/config/config_controller.go Outdated Show resolved Hide resolved
pkg/controller/syncset/syncset_controller.go Outdated Show resolved Hide resolved
pkg/controller/syncset/syncset_controller.go Outdated Show resolved Hide resolved
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from maxsmythe October 11, 2023 06:32
@ritazh ritazh added this to the v3.14.0 milestone Oct 11, 2023
@ritazh
Copy link
Member

ritazh commented Oct 11, 2023

@acpana can you please update #2393 to include what this PR covers and what still remains in order to close that issue out?

pkg/readiness/pruner/pruner.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/readiness/ready_tracker.go Show resolved Hide resolved
pkg/readiness/ready_tracker.go Outdated Show resolved Hide resolved
pkg/readiness/tracker_map.go Show resolved Hide resolved
pkg/watch/errorlist.go Outdated Show resolved Hide resolved
test/testutils/controller.go Outdated Show resolved Hide resolved
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
pkg/watch/errorlist.go Outdated Show resolved Hide resolved
pkg/watch/errorlist.go Outdated Show resolved Hide resolved
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from maxsmythe November 7, 2023 22:10
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from maxsmythe November 9, 2023 19:15
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Copy link
Contributor

@julianKatz julianKatz left a comment

Choose a reason for hiding this comment

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

Great work!! Way to stick with it.

passing the baton to Max to close things out on Google approval

pkg/cachemanager/aggregator/aggregator.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Show resolved Hide resolved
pkg/cachemanager/cachemanager_test.go Outdated Show resolved Hide resolved
pkg/controller/syncset/syncset_controller.go Show resolved Hide resolved
pkg/controller/syncset/syncset_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/syncset/syncset_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/syncset/syncset_controller_test.go Outdated Show resolved Hide resolved
pkg/watch/errorlist_test.go Show resolved Hide resolved
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@anlandu
Copy link
Member

anlandu commented Nov 11, 2023

Looks great!!

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

Once the bug in cache manager is addressed and the aggregator test has assertions, LGTM

pkg/cachemanager/aggregator/aggregator_test.go Outdated Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/readiness/pruner/pruner_test.go Show resolved Hide resolved
pkg/readiness/ready_tracker_unit_test.go Outdated Show resolved Hide resolved
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

Two minor fixes, then LGTM

pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

minor comments

pkg/readiness/pruner/pruner.go Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Show resolved Hide resolved
pkg/cachemanager/cachemanager.go Outdated Show resolved Hide resolved
pkg/cachemanager/aggregator/aggregator.go Outdated Show resolved Hide resolved
pkg/readiness/ready_tracker.go Show resolved Hide resolved
pkg/readiness/ready_tracker.go Outdated Show resolved Hide resolved
pkg/readiness/ready_tracker.go Outdated Show resolved Hide resolved
pkg/readiness/ready_tracker.go Outdated Show resolved Hide resolved
acpana and others added 3 commits November 22, 2023 11:59
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
Signed-off-by: alex <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from ritazh November 22, 2023 20:11
Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for getting this feature cross the finishing line! 🎉

@acpana acpana merged commit 6276cb2 into open-policy-agent:master Nov 23, 2023
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants