Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Decouple reconcilers from each other #180

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

adrianludwin
Copy link
Contributor

Instead of having the HC reconciler directly enqueue other reconcilers,
it now has a level of indirection through the forest. This allows the
anchor and object reconcilers - and, soon, the Hierarchical Resource
Quota reconcilers - to be notified of changes to the hierarchy, without
the HC reconciler having to know about them. (This change was prompted
by my work on HRQs, which I felt would overly complicate the HC
reconciler).

At the same time, I've removed the enqueues of the HNC Config
reconciler. Instead of reconciling whenever there was a change, with a
rate-limited maximum, it's now just on a periodic ticker.

Finally, I used the SetupWithManager functions as constructors to take
the initialization of certain fields out of internal/setup and put them
into the per-feature packages.

Tested: all e2e tests still work (I didn't try the ones that require
repair but those should be unaffected). Also tested this with my HRQ
changes and HRQ works correctly and fits in with minimal changes to the
rest of HNC.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 4, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianludwin

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

@k8s-ci-robot k8s-ci-robot requested review from rjbez17 and tashimi April 4, 2022 18:17
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 4, 2022
@adrianludwin
Copy link
Contributor Author

/assign @rjbez17

Also CC @erikgb , please feel free to leave comments but I'd like Ryan to approve since he has a bit more context here.

The HRQ implementation I allude to in the commit description is at https://github.com/adrianludwin/hierarchical-namespaces/tree/hrq.

Copy link
Contributor

@rjbez17 rjbez17 left a comment

Choose a reason for hiding this comment

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

A nit and a question, otherwise lgtm

Instead of having the HC reconciler directly enqueue other reconcilers,
it now has a level of indirection through the forest. This allows the
anchor and object reconcilers - and, soon, the Hierarchical Resource
Quota reconcilers - to be notified of changes to the hierarchy, without
the HC reconciler having to know about them. (This change was prompted
by my work on HRQs, which I felt would overly complicate the HC
reconciler).

At the same time, I've removed the enqueues of the HNC Config
reconciler. Instead of reconciling whenever there was a change, with a
rate-limited maximum, it's now just on a periodic ticker.

Finally, I used the SetupWithManager functions as constructors to take
the initialization of certain fields out of internal/setup and put them
into the per-feature packages.

Tested: all e2e tests still work (I didn't try the ones that require
repair but those should be unaffected). Also tested this with my HRQ
changes and HRQ works correctly and fits in with minimal changes to the
rest of HNC.
@adrianludwin
Copy link
Contributor Author

adrianludwin commented Apr 5, 2022 via email

@rjbez17
Copy link
Contributor

rjbez17 commented Apr 5, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 5, 2022
@k8s-ci-robot k8s-ci-robot merged commit c566204 into kubernetes-retired:master Apr 5, 2022
@adrianludwin adrianludwin deleted the enqueue branch April 5, 2022 15:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

3 participants