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

[v1.13] Author backports of Node Handler for wireguard, and dependent PR #25923

Merged
merged 4 commits into from
Jun 9, 2023

Conversation

bimmlerd
Copy link
Member

@bimmlerd bimmlerd commented Jun 6, 2023

Once this PR is merged, you can update the PR labels via:

for pr in 25450 25419; do contrib/backporting/set-labels.py $pr done 1.13; done

or with

make add-labels BRANCH=v1.13 ISSUES=25450,25419

[ upstream commit d8a0be6 ]

[backporter notes: fuzz_test doesn't exist yet]

Return pointer to implementing struct instead of implemented interface
from the constructor, as is commonly considered idiomatic Go. The
constructor is already in a linux-specific package. To ensure that we
really do implement the interface we want, add a static type check in
form of a variable assignment. As a side-effect, this allows us to drop
a number of type assertions in tests.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
[ upstream commit 8294624 ]

[ backporter notes: conflicts due to moved files, #25284 not yet
                    backported, hence no GetNodeIP() to move.]

The NodeHandler interface is too large, as can be seen in various
implementations which are only implementing a subset of methods. This
patch splits off the NodeID handling part, and removes the stub methods
from noop implementations.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
[ upstream commit 1aa06c6 ]

[ backporter notes: conflics due to moved files ]

The NodeHandler interface still contains two different concepts. Remove
the NodeNeighbor discovery/handling from it, and delete the different
stub implementations.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
[ upstream commit c8598f8 ]

[backporter notes: subscribing to node discovery works differently
                   and import path for LocalNodeConfig changed]

The reason the WireGuard agent node event handling was contained within
the linuxNodeHandler code was routing, which is no longer the case. In
addition, entangling the two leads to a deadlock, as diagnosed in GitHub
issue #24574.

This patch thus implements NodeHandler for the WireGuard agent, and
subscribes to the NodeManager itself. That way, the wait cycle of the
deadlock is broken, as the linuxNodeHandler doesn't acquire the IPCache
lock while holding its lock.

From the perspective of the agent, the invocations of the callbacks
change insofar that previously, only once the linuxNodeHandler
considered itself "initialised" it would forward node events.
Specifically, this excluded the initial sync of nodes performed on
subscribe. However, I didn't see a reason to specifically replicate this
behaviour.

Suggested-by: Sebastian Wicki <sebastian@isovalent.com>
Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
@bimmlerd bimmlerd requested a review from a team as a code owner June 6, 2023 08:47
@bimmlerd bimmlerd added kind/backports This PR provides functionality previously merged into master. backport/1.13 This PR represents a backport for Cilium 1.13.x of a PR that was merged to main. labels Jun 6, 2023
@bimmlerd bimmlerd requested a review from gandro June 6, 2023 08:47
@bimmlerd bimmlerd changed the title v1.13 Backports 2023-06-06 [v1.13] Author backports of Node Handler for wireguard, and dependent PR Jun 6, 2023
Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for the backporter notes

@bimmlerd
Copy link
Member Author

bimmlerd commented Jun 6, 2023

/test-backport-1.13

@bimmlerd
Copy link
Member Author

bimmlerd commented Jun 6, 2023

CI triage:

@bimmlerd
Copy link
Member Author

bimmlerd commented Jun 6, 2023

/test-runtime

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 9, 2023
@dylandreimerink dylandreimerink merged commit 549289c into v1.13 Jun 9, 2023
62 of 63 checks passed
@dylandreimerink dylandreimerink deleted the pr/v1.13-backport-2023-06-06 branch June 9, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.13 This PR represents a backport for Cilium 1.13.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants