-
Notifications
You must be signed in to change notification settings - Fork 157
Use temp network namespace for rename #325
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
base: master
Are you sure you want to change the base?
Conversation
0b97f8d to
0ffa338
Compare
fdf11d7 to
14b8542
Compare
|
Hi @adilGhaffarDev can you please fix the unit-tests please |
e89ae1f to
a66752c
Compare
I am working on them, I want to run the tests locally but it gives lot of permission related errors. example error: Is it possible to run these tests locally? in VM? |
a66752c to
89bf141
Compare
Nevermind it just needed sudo. |
e213f83 to
dd28ba8
Compare
All tests are now passing. Please take a look at the test case "should save all the netConf struct to the cache file without dns" in pkg/utils/utils_test.go. It was previously failing, although I hadn’t modified any related code. I’ve made some adjustments to address the failure, but I’m not entirely sure why it was failing in the first place. |
|
@adrianchiris @SchSeba please check |
dd28ba8 to
e0b5e0a
Compare
82d6540 to
d765377
Compare
|
Hi @adilGhaffarDev, |
7587548 to
5c28d18
Compare
Pull Request Test Coverage Report for Build 19429187032Details
💛 - Coveralls |
Now all issues are fixed 😄 |
adrianchiris
left a comment
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.
partial review. i still need to take a look at ReleaseVF
pkg/sriov/sriov.go
Outdated
| _ = s.utils.EnableArpAndNdiscNotify(podifName) | ||
| "tempNSObj", tempNSObj, | ||
| "netns.Fd()", int(netns.Fd())) | ||
| if err := s.nLink.LinkSetNsFd(tempNSObj, int(netns.Fd())); err != nil { |
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.
same as above we should use: err = ....
|
hi @adilGhaffarDev , I need a little clarification on the problem this PR is trying to solve, as I got no answer in #321 and the commit description does not describe it. Even with that information, we have to simplify the SetupVF function: with a 5 |
I have added in the description of PR what this PR is doing and why it is needed. |
|
my considerations are: |
fcc708a to
7eaa7c0
Compare
I have removed nested |
|
@SchSeba @zeeke @adrianchiris . take a look when you get time. |
zeeke
left a comment
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 simplifying the code. Left some comments
e6bb840 to
b3a97c7
Compare
|
@zeeke comments are addressed. |
|
@SchSeba @adrianchiris looking for reviews. |
zeeke
left a comment
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.
only one comment from my side.
thanks for all your rework
628c3bd to
2cc273e
Compare
zeeke
left a comment
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
Thanks for having addressed all my comments
|
@SchSeba @adrianchiris can we merge this? |
SchSeba
left a comment
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.
I think we are getting closer I like this solution more it's easier to read and follow I would say :p
ddc32b3 to
719aae2
Compare
|
@SchSeba comments are addressed. |
pkg/sriov/sriov.go
Outdated
| } | ||
|
|
||
| // Try to move interface back to initns | ||
| if nsLinkObj, e := s.nLink.LinkByName(linkName); e == nil { |
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.
if this line works https://github.com/k8snetworkplumbingwg/sriov-cni/pull/325/files#diff-3f93d9d758dfaab2615b76451d0a014c280e2aa12c0c97f60b2a5c8b2d68e589R202 then here we will not find the interface right?
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.
no it should be able to find because on line 203 we doing:
linkSetNameError := s.nLink.LinkSetName(nsLinkObj, linkName)
so at 211 we should be able to find the interface.
I am changing it bit to make it more clear.
Signed-off-by: Muhammad Adil Ghaffar <[email protected]>
719aae2 to
c7cbde8
Compare
This PR is changing how SetupVF sets up a VF in Pod netns.
Previous Approach:
New approach:
Previously we were setting temp name of the link now we move the link to tempNS.
Why we are doing this?
Check this issue:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1599
Rapid renaming of link causes race condition explained in the issue please check.
To solve the issue they used tempNS instead of renaming link: containernetworking/plugins#1073
We are trying to do the same in this PR.
Fixes #321