-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Make rootless-cni setup more robust #10865
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99 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 |
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.
Code LGTM. Could you add tests? #10857 looks like we could add it to the compose tests.
I cannot test this properly. Both fixes require changes to the host and I never want to change /etc/resolv.conf or remove /var/lib/cni since tests can run in CI and on developer machines. |
We could limit the test to only run in CI. I think there are more such cases. CI sets an env variable that we could use to run the tests only if set. |
Well, I guess we can run Anyway this is not a compose bug, every test with rootless cni will catch this, e.g. compose, integration and system test will all fail when the host setup is "wrong". |
The rootless cni namespace needs a valid /etc/resolv.conf file. On some distros is a symlink to somewhere under /run. Because the kernel will follow the symlink before mounting, it is not possible to mount a file at exactly /etc/resolv.conf. We have to ensure that the link target will be available in the rootless cni mount ns. Fixes containers#10855 Also fixed a bug in the /var/lib/cni directory lookup logic. It used `filepath.Base` instead of `filepath.Dir` and thus looping infinitely. Fixes containers#10857 [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <[email protected]>
Changes LGTM |
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
Can we cherry-pick this to v3.2? |
Yes, that is the plan. |
The rootless cni namespace needs a valid /etc/resolv.conf file. On some
distros is a symlink to somewhere under /run. Because the kernel will
follow the symlink before mounting, it is not possible to mount a file
at exactly /etc/resolv.conf. We have to ensure that the link target will
be available in the rootless cni mount ns.
Fixes #10855
Also fixed a bug in the /var/lib/cni directory lookup logic. It used
filepath.Base
instead offilepath.Dir
and thus looping infinitely.Fixes #10857