Skip to content
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

refactor: cri setup network before creating sandbox #2819

Merged
merged 3 commits into from
May 5, 2019

Conversation

zhuangqh
Copy link
Contributor

Ⅰ. Describe what this PR did

VM-like container required the network initialization before creating sandbox container. This order won't affect the runc container.

  • introduce a new NetworkMode named netns, which enable to directly specific the net namespace path in the OCI spec, and skip any network prepare job.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

should act like before.

Ⅳ. Describe how to verify it

pass the CRI test

Ⅴ. Special notes for reviews

We managed the CNI netns life cycle by ourselves. There should not have any resource leaks.

VM-like container required the network initialization before
creating sandbox container. This order won't affect the
runc container.

Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
@codecov
Copy link

codecov bot commented Apr 30, 2019

Codecov Report

Merging #2819 into master will decrease coverage by 0.07%.
The diff coverage is 52.4%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2819      +/-   ##
==========================================
- Coverage   69.34%   69.26%   -0.08%     
==========================================
  Files         278      279       +1     
  Lines       17428    17533     +105     
==========================================
+ Hits        12085    12145      +60     
- Misses       3994     4026      +32     
- Partials     1349     1362      +13
Flag Coverage Δ
#criv1alpha2_test 39.26% <47.59%> (+0.02%) ⬆️
#integration_test_0 36.34% <6.02%> (-0.23%) ⬇️
#integration_test_1 35.19% <6.02%> (-0.15%) ⬇️
#integration_test_2 36.36% <6.02%> (-0.19%) ⬇️
#integration_test_3 35.23% <6.02%> (-0.14%) ⬇️
#node_e2e_test 35.03% <52.4%> (+0.03%) ⬆️
#unittest 28.74% <0%> (-0.05%) ⬇️
Impacted Files Coverage Δ
daemon/mgr/container.go 60.06% <100%> (+0.65%) ⬆️
daemon/mgr/spec_linux.go 79.15% <100%> (+0.14%) ⬆️
cri/v1alpha2/cri_utils.go 89.43% <100%> (+0.59%) ⬆️
cri/ocicni/cni_manager.go 58.49% <100%> (-0.34%) ⬇️
daemon/mgr/network_utils.go 41.3% <100%> (+4.09%) ⬆️
cri/v1alpha2/cri.go 68.98% <22%> (-1.61%) ⬇️
ctrd/supervisord/daemon.go 47.92% <30.76%> (-1.14%) ⬇️
cri/ocicni/netns.go 58.1% <58.1%> (ø)
daemon/logger/jsonfile/utils.go 71.54% <0%> (-1.63%) ⬇️
ctrd/client.go 69.72% <0%> (-1.63%) ⬇️
... and 8 more

Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants