GithubHelp home page GithubHelp logo

Comments (4)

nagiesek avatar nagiesek commented on July 19, 2024

I'm working on other projects but I'll try and slip this in this week.

from windows-container-networking.

daschott avatar daschott commented on July 19, 2024

@Keith-Mange FYI

from windows-container-networking.

aznashwan avatar aznashwan commented on July 19, 2024

Another option is to have the executables named to match the NetworkType, and then we can just use config.Type instead of config.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.

FWIW this exact approach was marged in #94 as seen here.

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.

from windows-container-networking.

TBBle avatar TBBle commented on July 19, 2024
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 sdnbridge and sdnoverlay, but those are not documented NetworkMode values. The examples seem to mostly expect binaries named l2bridge and l2tunnel (which aren't output here), but the flannel and dual-stack examples still reference the sdn* names, which I expect will still fail with the error in my original example.

Unless I'm overlooking some point where the sdn* names are translated into the HCN expected enum values... I note that the in-tree test code is not using the executable names, but passing the expected NetworkType values directly into util.MakeTestStruct, so the executable-name part isn't being covered by the test suite.

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 NetworkType enum is the shortest-path workaround.

Thinking further about it, and also in relation to this comment:

// getOrCreateNetwork
// TODO: Require network to be created beforehand and make it an error of the network is not found.
// Once that is done, remove this function.

perhaps the long-term solution is to complete this TODO, and then unifiy the plugins into a single type wincni. AFAICT from GitHub-browsing the source, if the network already exists, the type from the CNI config file is not actually used, we trust the type of the existing HCN network.

The only place I can see accessing the CNI config's Type is GetHostComputeNetworkConfig, itself only called during CreateNetwork.

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 Overlay network, you can trivially use that network's name in your CNI config, and a network type of nat (or NAT, or nAt, but that's a different issue), and it'll process it as an Overlay network based on the details retrieved from HCN. I suspect this is how this issue has slipped under the radar, if the general users of this repo are pre-creating their networks, then there's no failure with calling the sdnoverlay executable by CNI Config Type sdnoverlay but referencing an Overlay (or L2Bridge, or NAT) network.

from windows-container-networking.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.