-
Notifications
You must be signed in to change notification settings - Fork 672
Allow CNI caller to supply blank netns; upgrade cni library to version 0.5.0 #2850
Conversation
Also don't error on DEL with no namespace and no addresses
CNI_VERSION env var was never used, so removed from the test script. The second test is crashing on v1, so bumped to v3.
I think one problem is that there is no cniVersion member in the weave configuration:
I suspect (no confirmation) that the runtime then assumes the latest version. It might be that setting |
That's an interesting idea, but the CNI spec says that an absence of version shall be interpreted as version 0.1, and the currently-released Weave Net plugin is at CNI spec level 0.1. As discussed on sig-network Slack, kubelet needs to be prepared for the DEL to error, and move on past that operation at some point. |
@@ -70,28 +77,31 @@ func (c *CNIPlugin) CmdAdd(args *skel.CmdArgs) error { | |||
if err != nil { | |||
return fmt.Errorf("unable to allocate IP address: %s", err) | |||
} | |||
// Only expecting one address | |||
ip := result.IPs[0] |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I can confirm that this fixes the weave-kube problem with v1.6. |
Thanks @luxas; we will make a new release soon which will have a higher version number. |
Was this merged into master as well? |
@luxas merged to master now; sorry for oversight However the CI build flaked first time |
Prompted by the impending release of Kubernetes 1.6, which seems to rely on the behaviour that a blank netns is allowed on DEL.
Lots of lines changed, because the CNI return format changed. The library should take care of returning backwards-compatible results to older runtimes.