-
Notifications
You must be signed in to change notification settings - Fork 43
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
adds optional loopbackDSR argument to cni conf #60
Conversation
Tests pass okay? |
I validated the changes on an active Kubernetes cluster, but haven't run the tests yet. Will let you know when I have a successful test pass. |
Updated with suggestions and tested the latest changes -- please review |
LGTM |
func (config *NetworkConfig) GetNetworkInfo(podNamespace string) *network.NetworkInfo { | ||
func (config *NetworkConfig) GetNetworkInfo(podNamespace string) (ninfo *network.NetworkInfo, err error) { | ||
if config.OptionalFlags.LoopbackDSR { | ||
if err := hcn.DSRSupported(); err != nil { |
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 am not well versed in golang, so bear with me) Why is err := hcn.DSRSupported(); included in the if condition? does this if condition basically come down to err != nil and have you tested that?
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.
Yes, I actually encountered this condition on RS5 by using older hcsshim version that did not include microsoft/hcsshim#848 (it was using the old DSR version check, hence it failed on RS5).
This inline assignment and error check in the If statement is a common idiom in Golang, e.g. see: https://golang.org/doc/effective_go#if
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.
awesome, thanks David! maybe I will use this in the future :)
f972fe1
to
6cdcf01
Compare
6cdcf01
to
b9911ee
Compare
lgtm |
This is intended to address kubernetes-sigs/sig-windows-tools#119