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
BGP-CP: Remove NodeSpecer and ControlPlaneState #27285
BGP-CP: Remove NodeSpecer and ControlPlaneState #27285
Conversation
This commit makes the previously private 'newTestLocalNodeStore' constructor public and also updates the constructor to receive a mock LocalNode structure. The returned 'LocalNodeStore' will then "emit" the mock LocalNode when invoked. This is useful for unit tests which include the 'LocalNodeStore' structure as a depedency, avoiding the need to create a Hive for the unit test. These changes will be used in subsequent commits. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
/test |
0a58aa6
to
68fc1b8
Compare
/test |
Is this changing a user-facing interface or will it have user-facing consequences? If yes, release note seems fine though I'm not sure whether users will understand it. If no, this should probably be labelled with |
68fc1b8
to
6724985
Compare
@joestringer no user facing changes. I'll update the label to misc. |
6724985
to
e27e4ed
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found just some nits, overall a great change!
e27e4ed
to
ad19b90
Compare
Introduce a helper method for resolving the RouterID with a parsed BGP-CP annotation. This will be used in subsequent commits Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
This commit removes usages of NodeSpecer and ControlPlaneState from the BGP Control Plane. With the inclusion of LocalNodeStore we no longer need the NodeSpecer abstraction nor the ControlPlaneState. Moving forward all ConfigReconcilers will get a read-only node.LocalNode object to inspect the current state of the Cilium node. If a ConfigReconciler needs more information then this they can now "request" depedencies via the Hive/Cell depedency injection graph (DIG). All ConfigReconcilers are part of the DIG and thus can declare depedencies via their constructor's parameters. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
This commit removes all references to NodeSpecer and ControlPlaneState. The previous commit removed them from the BGP CP. See the previous commit for further explanation. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
This commit updates the BGP-CP unit tests to work correct after the removal of NodeSpecer and ControlPlaneState structures. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
32862d1
to
5f20b29
Compare
/test |
5f20b29
to
c98595a
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall 👍 Thanks for your big effort! This makes code much simpler and easy to change.
One non-blocking suggestion. How about splitting each reconcilers into separated files? That makes the code easy to read, reduce the risk of conflict when we introduce a new reconciler, etc.
@YutaroHayakawa was thinking this as well, but we probably want to keep the code a bit similar for backporting reasons (if we need to). We can do this split in a follow up pull-request? I do agree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Prior to this PR only label changes made to the Kubernetes Node object would propagate to LocalNodeStore updates. This commit adds Annotations to this mix as well. This is useful as the BGP-CP now observes the LocalNodeStore and requires events to occur when annotations are updated. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
c98595a
to
551016d
Compare
/test |
I have a local rebase of #27100 with this PR. @joamaki @aditighag PTAL and merge when you have a moment. |
I don't have much context for the endpoint related changes. As this is a BGP focused change, feel free to go ahead with the merge based on the existing reviews. If there is anything specific you want me to look at in the endpoint manager change, please ping me. |
@aditighag i think endpoint team was required due to the first and last commit, which arent exactly BGP related, rather, we now trigger LocalNodeStore updates on annotation changes. Can you review just those two commits? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for highlighting the commits that are not BGP specific. I've left some review comments. Mainly, it's not clear to me how some of the changes may affect other subsystems subscribing to node events.
Due to the merge of cilium#27182 before cilium#27285 a bug was introduced in pkg/bgpv1/manager/manager_test.go. This commit fixes the issue. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
required for 1.14.6 only, alternative is to backport cilium#27285
This PR removes the NodeSpecer abstraction and the ControlPlaneState structure from the BGP control plane.
Now that LocalNodeStore is available it can be used in place of these two constructs.
Additionally, since all ConfigReconcilers are now part of the Hive/Cell dependency injection graph, each ConfigReconciler can declare their own depedencies at time of construction. This provides much greater flexibility as a ConfigReconciler can now utilize any entities available in the DIG to perform their necessary reconciliation.