-
Notifications
You must be signed in to change notification settings - Fork 598
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
check version incompatibility #762
Conversation
Pull Request Test Coverage Report for Build 1481899134
💛 - Coveralls |
Changes unknown |
Hey @bn222 ! Thanks for the contribution. We'll also need to take care of this in the next generation configuration generation, which can be found approximately here: https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/cmd/controller/main.go |
Hi @dougbtv, I'm not sure what I should change in the two files you mention. I guess you might actually mean the following file: https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/pkg/config/generator.go#L37 I could enforce checking that the delegate configurations are using a compatible CNI version, although that would require me to change the type of Delegates in MultusConf if we want to avoid converting to json and checking the cni version in json. Let me know what you think! |
Hey Balazs, what I mean is that we have two methods for entrypoint as we're in a transition (which will be superceded by the go code, making the bash script obsolete) So, in two different modes, either the bash runs, or the go runs (the files I linked) Meaning that you'll have to implement the equivalent logic in the the go code as well as the bash 👍 |
65c153a
to
69d8dd7
Compare
@dougbtv afaict, this covers the code path that goes through the thick plugin. Let me know if more paths need patching. |
This pull request introduces 1 alert when merging 69d8dd7 into 4d9731b - view on LGTM.com new alerts:
|
038c6f8
to
e5ac226
Compare
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.
Other than the comments I'm providing in the code, I can't help to notice that the new functionality is not being unit tested; you'll have to provide these tests as well.
I also disagree with your choice of where to implement this: I think it should be done in the configuration generator constructor, not in its generate method.
c210048
to
895905b
Compare
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.
It feels a bit weird to not check the error on newMultusConfigWithDelegates
now that it can return one.
Unfortunately, I don't have a good alternative to doing that: either check it on the test's body, or introduce another helper for it.
Pretty much everything else is opinionated.
When top level CNI version is 0.4.0 or more, nested CNI version can't be less than 0.4.0 since these are incompatible. This closes issue k8snetworkplumbingwg#737. Signed-off-by: Balazs Nemeth <[email protected]>
Similarly to disallowing incompatible versions in entrypoint.sh, add the same logic in go for the thick plugin. Signed-off-by: Balazs Nemeth <[email protected]>
Signed-off-by: Balazs Nemeth <[email protected]>
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.
Thanks for the patience, and for the patch.
@dougbtv I've only reviewed the golang related code.
It looks good to me. Apologize that the PR takes a very long time. Let me merge into master. Thank you so much! |
* multus: entrypoint: disallow incompatible cni versions When top level CNI version is 0.4.0 or more, nested CNI version can't be less than 0.4.0 since these are incompatible. This closes issue k8snetworkplumbingwg#737. Signed-off-by: Balazs Nemeth <[email protected]> * multus: thick: disallow incompatible cni versions Similarly to disallowing incompatible versions in entrypoint.sh, add the same logic in go for the thick plugin. Signed-off-by: Balazs Nemeth <[email protected]> * multus: add unit test for incompatible cni versions Signed-off-by: Balazs Nemeth <[email protected]>
* multus: entrypoint: disallow incompatible cni versions When top level CNI version is 0.4.0 or more, nested CNI version can't be less than 0.4.0 since these are incompatible. This closes issue #737. Signed-off-by: Balazs Nemeth <[email protected]> * multus: thick: disallow incompatible cni versions Similarly to disallowing incompatible versions in entrypoint.sh, add the same logic in go for the thick plugin. Signed-off-by: Balazs Nemeth <[email protected]> * multus: add unit test for incompatible cni versions Signed-off-by: Balazs Nemeth <[email protected]> Co-authored-by: Balazs Nemeth <[email protected]>
* multus: entrypoint: disallow incompatible cni versions When top level CNI version is 0.4.0 or more, nested CNI version can't be less than 0.4.0 since these are incompatible. This closes issue #737. Signed-off-by: Balazs Nemeth <[email protected]> * multus: thick: disallow incompatible cni versions Similarly to disallowing incompatible versions in entrypoint.sh, add the same logic in go for the thick plugin. Signed-off-by: Balazs Nemeth <[email protected]> * multus: add unit test for incompatible cni versions Signed-off-by: Balazs Nemeth <[email protected]> Co-authored-by: Balazs Nemeth <[email protected]>
* multus: entrypoint: disallow incompatible cni versions When top level CNI version is 0.4.0 or more, nested CNI version can't be less than 0.4.0 since these are incompatible. This closes issue k8snetworkplumbingwg#737. Signed-off-by: Balazs Nemeth <[email protected]> * multus: thick: disallow incompatible cni versions Similarly to disallowing incompatible versions in entrypoint.sh, add the same logic in go for the thick plugin. Signed-off-by: Balazs Nemeth <[email protected]> * multus: add unit test for incompatible cni versions Signed-off-by: Balazs Nemeth <[email protected]>
…lumbingwg#798) * multus: entrypoint: disallow incompatible cni versions When top level CNI version is 0.4.0 or more, nested CNI version can't be less than 0.4.0 since these are incompatible. This closes issue k8snetworkplumbingwg#737. Signed-off-by: Balazs Nemeth <[email protected]> * multus: thick: disallow incompatible cni versions Similarly to disallowing incompatible versions in entrypoint.sh, add the same logic in go for the thick plugin. Signed-off-by: Balazs Nemeth <[email protected]> * multus: add unit test for incompatible cni versions Signed-off-by: Balazs Nemeth <[email protected]> Co-authored-by: Balazs Nemeth <[email protected]>
When nested CNI version is 0.3.1 or less while the top level CNI version
is 0.4.0, error out. Version 0.3.1 or less doesn't support the CHECK
command. This closes issue #737.