-
Notifications
You must be signed in to change notification settings - Fork 576
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
Allows cmdDel to finish if netns doesn't exist #269
Allows cmdDel to finish if netns doesn't exist #269
Conversation
…Close() in such a case
Pull Request Test Coverage Report for Build 662
💛 - Coveralls |
@@ -402,11 +402,15 @@ func cmdDel(args *skel.CmdArgs, exec invoke.Exec, kubeClient k8s.KubeClient) err | |||
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444 | |||
_, ok := err.(ns.NSPathNotExistErr) | |||
if ok { | |||
return nil | |||
logging.Debugf("cmdDel: WARNING netns may not exist, netns: %s, err: %s", netns, err) |
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.
if there is no namespace, it should delegate the issue to the plugins ? Example Bridge plugin: https://github.com/containernetworking/plugins/blob/master/plugins/main/bridge/bridge.go#L508
Macvlan plugin: https://github.com/containernetworking/plugins/blob/master/plugins/main/macvlan/macvlan.go#L251
So the conclusion is the delegate plugins should take care of the issues, Multus should delegate it ?
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.
I think so, consider the case without Multus that the plugin is being called directly -- the plugin would have to handle this case just the same.
And in the case where the plugin has cleanup to do that's irrespective of the namespace being there or not, it can still perform that cleanup.
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.
That is cool.. Agreed
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.
LGTM :) Ready to merge
More detail in the referenced issue. Generally the gist is that while a pod is in a failed state, the netns that Multus receives doesn't exist and the
cmdDel
function returns prematurely. With the premature return, we don't call the delegates during the delete -- in the case that the delegated CNI plugin needs to perform cleanup functions, this can leave it in a dirty state.This fix lets the cmdDel continue.
Fixes #267