-
Notifications
You must be signed in to change notification settings - Fork 52
Add support for multiple pod networks #12
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
Conversation
rajatchopra
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.
Looks fine to me, except one comment above. I will give it another pass tomorrow.
Did we want to expose any other functions meanwhile? Like GetNetwork? so that the library can be used for other purposes?
pkg/ocicni/ocicni.go
Outdated
|
|
||
| // Search for vendor-specific plugins as well as default plugins in the CNI codebase. | ||
| vendorDir := vendorCNIDir(vendorCNIDirPrefix, confList.Plugins[0].Network.Type) | ||
| vendorDir := vendorCNIDir(plugin.vendorCNIDirPrefix, confList.Plugins[0].Network.Type) |
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.
Could we flatten Plugins and all the Plugin.Network.Type in the Path? Plugins[0] will still leave it selective.
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.
Could we flatten Plugins and all the Plugin.Network.Type in the Path? Plugins[0] will still leave it selective.
@rajatchopra done
Maybe let's see if anyone asks for it before we do? |
dc8311c to
6f12daf
Compare
|
Holding off on proposing this for merge until CNI containernetworking/cni#558 lands. |
|
@baude @mheon @rajatchopra @cri-o/ocicni-maintainers PTAL thanks! |
|
Thought this was under CRI-O... |
Signed-off-by: Dan Williams <[email protected]>
|
@dcbw Can your rebase? |
07c1a6da47b7fbf8b357f4949ecce2113e598491 (0.7.0-alpha1)
Ginkgo: 7f8ab55aaf3b86885aa55b762e803744d1674700 (v1.2.0-29-g7f8ab55) Gomega: 2152b45fa28a361beba9aab0885972323a444e28 (v1.0-71-g2152b45)
PodNetwork has a new member "Networks" which takes an array of strings. These map to CNI configuration network names (the "name" field of CNI config JSON). If Networks is left empty, then the previous behavior of using the first found config in /etc/cni/net.d still happens. Signed-off-by: Dan Williams <[email protected]>
|
@mrunalp done, new commit added (missing default network...) |
|
@dcbw Tests think you need to gofmt your code. |
We should only look in a single directory for config files, but allow the user to specify multiple binary directories (like vendor-specific ones) in which to look for plugin binaries. Parly ports of Kubernetes changes: 69ac723b78464b9474f9c069bbfd3dbbdbd19239 cni: convert "vendor" option to multiple plugin binary search paths 16eaaaed836ed66fac76f8624d528bc8cd4426bb cni: clarify bin/conf directory variable names And partly cleanups of the watcher/monitor code to enable better testing.
It doesn't really need anything from 'plugin' so we might as well make it more testable.
syncNetworkConfig() would fail to populate the network list if the default network was not found, which prevents containers that want non-default networks from being networked.
|
LGTM |
1 similar comment
|
LGTM |
|
vendoring this in crio produces the following: @dcbw could you help me out? 👼 |
PodNetwork has a new member "Networks" which takes an array of
strings. These map to CNI configuration network names (the "name"
field of CNI config JSON).
If Networks is left empty, then the previous behavior of using
the first found config in /etc/cni/net.d still happens.
Signed-off-by: Dan Williams [email protected]
@mrunalp @rajatchopra what do you guys think?