-
Notifications
You must be signed in to change notification settings - Fork 950
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
upgrade: upgrade the vendor of cri-o/ocicni #2282
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2282 +/- ##
==========================================
+ Coverage 66.97% 67.05% +0.08%
==========================================
Files 211 211
Lines 17306 17315 +9
==========================================
+ Hits 11591 11611 +20
+ Misses 4312 4304 -8
+ Partials 1403 1400 -3
|
49588f5
to
f27873b
Compare
cri/ocicni/cni_manager.go
Outdated
return ip, nil | ||
if len(results) > 0 { | ||
// NOTE: only get the first IP of the first network at present | ||
result := results[0].(*cnicurrent.Result) |
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.
could we use (val, ok) to do assertion? because it's safe 😅
f57f394
to
9af1907
Compare
Any update on this? Still WIP? @starnop |
d361f82
to
191dfca
Compare
@allencloud has been updated. :) |
@fuweid @YaoZengzeng PTAL. ^_^ |
cri/ocicni/cni_manager.go
Outdated
if len(results) > 0 { | ||
// NOTE: only get the first IP of the first network at present | ||
// TODO: support multiple network | ||
if result, ok := results[0].(*cnicurrent.Result); ok { |
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.
so, is the first one the *cnicurrent.Result
?
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.
Yeah. as comments mentioned, we only get the first IP of the first network at present. :)
@@ -32,7 +33,7 @@ func NewCniManager(cfg *config.Config) (CniMgr, error) { | |||
} | |||
} | |||
|
|||
plugin, err := ocicni.InitCNI(networkPluginConfDir, networkPluginBinDir) | |||
plugin, err := ocicni.InitCNI("", networkPluginConfDir, networkPluginBinDir) |
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.
@starnop could you comment here for the reason why we set it empty?
cri/ocicni/cni_manager.go
Outdated
if err != nil { | ||
return "", fmt.Errorf("failed to get pod network status: %v", err) | ||
} | ||
|
||
return ip, nil | ||
if len(results) > 0 { |
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 suggest that we could use return fast
to ident less.
if len(results)==0{
return "", fmt.Errorf("failed to get pod network status for nil result")
}
if result, ok := results[0].(*cnicurrent.Result); !ok {
return "", fmt.Errorf("failed to get pod network status for wrong result: %+v", results[0])
}
if len(result.IPs) == 0 {
return "", fmt.Errorf("failed to get pod network status for nil IP")
}
ip := result.IPs[0].Address.IP.String()
return ip, nil
I think we could merge this until we finish some minor change. @starnop |
Signed-off-by: Starnop <starnop@163.com>
All above mentioned has been updated. :) |
LGTM by @fuweid |
Signed-off-by: Starnop starnop@163.com
Ⅰ. Describe what this PR did
At present,
cri-o/ocicni
will watch CNI configuration file through inotify and quit if inofity runs out without any error report, it's not make sense. Fortunately, the issue has been settled at cri-o/ocicni@0831829 . So we update the vendor ofcri-o/ocicni
Ⅱ. Does this pull request fix one issue?
None.
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
use command
sudo sysctl -w fs.inotify.max_user_instances=10
to limit the inotify, and you will get error like this:Ⅴ. Special notes for reviews
BTY, update the vendor of
github.com/containernetworking/cni
.