-
Notifications
You must be signed in to change notification settings - Fork 43
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
Untie the HCS NetworkType from the network name #57
Comments
I'm working on other projects but I'll try and slip this in this week. |
@Keith-Mange FYI |
Scratch that, that was an unrelated issue which doesn't fix the actual underlying problem, and the failure to map the binary names to the HCN types still occurs. Will propose some sort of solution (or at least a proper workaround) soon. |
I wrote this part before the above comment was modified. Looks like it was updated with the same conclusion.Interesting. Poking around, it doesn't seem that the issue was resolved that the Makefile produces binaries named Unless I'm overlooking some point where the That said, since we've already gone down this path, perhaps simply changing the Makefile (and whatever else is lying around like the examples) to output executables to match the Thinking further about it, and also in relation to this comment:
perhaps the long-term solution is to complete this TODO, and then unifiy the plugins into a single type The only place I can see accessing the CNI config's Type is I'm not sure about the history of this comment or the decision to require pre-creating networks (That seems like CNI's role to my limited understanding) so this might not be a viable path. I also admit I don't know off-hand how I would pre-create the NAT network, for example. Which suggests a different interesting issue: If you pre-create an |
Currently, the
network.NetworkInfo.Type
value passed through to HCS (which must be one ofnetwork.NetworkType
, i.e.hcn.NetworkType
values) is simply the network name. This is pretty surprising, and also breaks the CNI spec if you want multiple networks of the same type, as each plugin or plugin-list must have a host-unique name.It also means none of the example configs work, as they will all complain with something like the below:
This appears to be deliberate, but it's not very user-friendly.
The obvious approach seems to me to have each of the executables specify their own
NetworkType
when they call intocore.Core
, since the network type used appears to be the only intended distinction between the executables. I started trying to plumb this approach through, but got lost in the abstraction layers, trying to work out how to carry that value without needing to put a hard-coded[string]NetworkType
map somewhere in the system, or pull a bunch of stuff into thecore
package.Another option would be to expose the network type as an additional parameter, and just produce one executable that covers all the use-cases, which is really what we have now anyway, but be intentional about it.
Another option is to have the executables named to match the
NetworkType
, and then we can just useconfig.Type
instead ofconfig.Name
, and there's little-to-no surprise, as long as no one renames their own executable. Again, this is really just one executable compiled three times, so not really a great approach, I feel.So I'm interested in guidance and suggestions. This has come up while working on porting BuildKit to Windows, as the only network layer it supports natively is CNI, so I needed minimally-functional CNI with NAT, ala the
nat
CNI plugin I found here. I used the lattermost option as my workaround, but without renaming binaries it only works fornat
, notsdnoverlay
orsdnbridge
, as those are notNetworkType
values.The text was updated successfully, but these errors were encountered: