-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
kubelet: make --cni-bin-dir accept a comma-separated list of CNI plugin directories #58714
Conversation
b4c04ed
to
a731acb
Compare
/test pull-kubernetes-bazel-test |
cmd/kubelet/app/server.go
Outdated
@@ -980,7 +981,7 @@ func RunDockershim(f *options.KubeletFlags, c *kubeletconfiginternal.KubeletConf | |||
NonMasqueradeCIDR: f.NonMasqueradeCIDR, | |||
PluginName: r.NetworkPluginName, | |||
PluginConfDir: r.CNIConfDir, | |||
PluginBinDir: r.CNIBinDir, | |||
PluginBinDirs: strings.Split(r.CNIBinDir, ":"), |
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.
Use comma instead of colon? ":" is part of dir name on Windows
70a1f57
to
df90d8b
Compare
@feiskyer how about now? Changed to comma-separated. |
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
@derekwaynecarr or maybe a quick look from you too.. Thanks! |
@vishh or maybe you? Thanks! |
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
cc @derekwaynecarr for approval |
return true | ||
found := false | ||
for _, dir := range plugin.binDirs { | ||
found = found || plugin.checkCNIPluginInOneDir(dir) |
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.
Is there any reason not to break/return once the plugin is found?
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.
Fixed.
// kubenet will search for cni binaries in DefaultCNIDir first, then continue to vendorDir. | ||
vendorDir string | ||
// binDirs is passed by kubelet cni-bin-dir parameter. | ||
// kubenet will search for CNI binaries in DefaultCNIDir first, then continue to binDirs. |
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.
Not related to the changes in this PR specifically, but why does kubenet always searches the default directory? The description of the flag --cni-bin-dir
does not indicate that the list of directories are in addition to the default...
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.
pluginDir -> confDir DefaultNetDir -> DefaultConfDir DefaultCNIDir -> DefaultBinDir
It's only used for the test code and after talking with Rajat, the vendor stuff was never really used anyway. So convert the vendor code into a plain array of plugin binary search paths, which is all the vendor code was doing anyway.
…in directories Allow CNI-related network plugin drivers (kubenet, cni) to search a list of directories for plugin binaries instead of just one. This allows using an administrator-provided path and fallbacks to others (like the previous default of /opt/cni/bin) for backwards compatibility.
@yujuhong PTAL thanks! |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dcbw, feiskyer, yujuhong 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 |
/retest Review the full test history for this PR. Silence the bot with an |
4 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
@dcbw: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Review the full test history for this PR. Silence the bot with an |
[MILESTONENOTIFIER] Milestone Pull Request Labels Incomplete @dcbw @derekwaynecarr @feiskyer @yujuhong Action required: This pull request requires label changes. If the required changes are not made within 3 days, the pull request will be moved out of the v1.11 milestone. kind: Must specify exactly one of |
Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Allow CNI-related network plugin drivers (kubenet, cni) to search a list of
directories for plugin binaries instead of just one. This allows using an
administrator-provided path and fallbacks to others (like the previous default
of /opt/cni/bin) for backwards compatibility.
@kubernetes/rh-networking @kubernetes/sig-network-misc @freehan @pecameron @rajatchopra