-
Notifications
You must be signed in to change notification settings - Fork 49
Fix cni config type. #45
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
Signed-off-by: Lantao Liu <lantaol@google.com>
|
/cc @jterry75 |
|
You're testing this on nat? I think this will break sdnbridge. Overlay should still work. Ideally we could remove type from the networkInfo, and remove the create network portion. |
|
@nagiesek Yes. I'm using nat. Are we intentionally using It doesn't look correct to me. Based on https://docs.microsoft.com/en-us/windows-server/networking/technologies/hcn/hcn-json-document-schemas, the type should be a predefined enum, isn't it? Without this fix, I get |
|
Any updates on this? I tried to keep After applying this fix, and have the |
|
The short answer is I can merge this, but there needs to be some sort of switch statement that selects the correct network type for the plugin being used, as this will break the network creation code path for sdnbridge & sdnoverlay. Should be just a short control setting the value of However my intention is to remove the code that conditionally creates the network if it cannot be found, and make it a seperate setup requirement for using these cni plugins. So you could also just change the line here to return an error instead of trying to create the network, and that'd help me out too. |
|
@nagiesek - I'm not sure I follow. Can you give me a code sample of what you want @Random-Liu to do here? |
|
I worked around this in the test environment by reusing the @nagiesek However, it is really not clear what I should put in the |
Sorry, I really should add some long form documentation here, I'll file an issue on myself. We're not using the network name as the cni type here. You are right to suspect hackiness though. We use network name to determine the network type. Essentially what this code path does is try to find a network (in a very simplified model: grouping of a vswitch and a subnet) with the name specified in the cni If your network is named "nat" that will work as "nat" is a valid type for us, but if your network is named "MyNetwork" the code will try to create a network of type "MyNetwork" which will fail. So putting cni type into the field here will also not work, but from the cni type we can determine the correct network type. All in all the network creation does not belong in the cni plugins, and I will remove this conditional network creation. My requirement is that the network is created beforehand, as the setup is complicated for the non-nat case. |
|
fixed in #54 by removing network creation logic |
Fix the network type.
The network type is set to a wrong value, hence it stops working.
Signed-off-by: Lantao Liu lantaol@google.com