-
Notifications
You must be signed in to change notification settings - Fork 243
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
Migrate tools veth
to new link structs
#1523
Conversation
1d03ce0
to
6c29712
Compare
6c29712
to
0bb1ebd
Compare
0bb1ebd
to
07c6964
Compare
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.
Hi @steiler
thank your for looking into this depthness of repeated links creation.
When I was reviewing this I couldn't shake off the feeling that we should leverage the existing clab.NewNode function to create nodes for us to later resolve them.
So my approach here was to
-
create fake nodes that represent the nodes between which the veth pair is to be laid out. The fake nodes are created with c.NewNode existing function, so we don't have to create anything new.
-
the fake "linux" node is created for a regular endpoint, since it is a good enough to attach a veth. For host and bridge the relevant node kinds are created.
-
Once the fake nodes are created, we can create a linkBrief link type as if it was passed from the topology in brief format. That way we rely on the same link resolving process, reusing the code paths we use for regular deployment.
return &EndpointGeneric{ | ||
Node: node, | ||
IfaceName: iface, | ||
// random name is generated for the endpoint to avoid name collisions | ||
// when it is first deployed in the root namespace | ||
randName: genRandomIfName(), | ||
Link: link, |
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.
now that I don't quite use link directly in the endpoint, I think this can even be removed...
But maybe it will be useful for smth
tools veth
to new link structs
2d59084
to
ae74bd2
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1523 +/- ##
==========================================
- Coverage 49.45% 48.29% -1.17%
==========================================
Files 136 132 -4
Lines 13231 12607 -624
==========================================
- Hits 6544 6089 -455
+ Misses 5956 5840 -116
+ Partials 731 678 -53
|
No description provided.