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

feature: cli support --add-host #2919

Closed
wants to merge 1 commit into from

Conversation

lang710
Copy link
Contributor

@lang710 lang710 commented Jun 20, 2019

Signed-off-by: Lang Chi 21860405@zju.edu.cn

Ⅰ. Describe what this PR did

feature: cli support --add-host

Ⅱ. Does this pull request fix one issue?

NONE

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

Added

Ⅳ. Describe how to verify it

root@compatibility:~# pouch run --add-host=extra:86.75.30.9 busybox grep extra /etc/hosts
86.75.30.9	extra
root@compatibility:~# pouch run --add-host=extra:1.2.3.4 --net=host busybox cat /etc/hosts
127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
1.2.3.4	extra
root@compatibility:~# pouch run --net=container:other --add-host=name:8.8.8.8 busybox ps
Error: failed to run container: {"message":"Conflicting options: custom host-to-IP mapping and the network mode"}

Ⅴ. Special notes for reviews

@codecov
Copy link

codecov bot commented Jun 20, 2019

Codecov Report

Merging #2919 into master will increase coverage by 0.17%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2919      +/-   ##
==========================================
+ Coverage   67.91%   68.09%   +0.17%     
==========================================
  Files         291      291              
  Lines       18691    18387     -304     
==========================================
- Hits        12694    12520     -174     
+ Misses       4515     4399     -116     
+ Partials     1482     1468      -14     
Flag Coverage Δ
#criv1alpha2_test 34.69% <0.00%> (+0.19%) ⬆️
#integration_test_0 36.04% <61.11%> (-0.34%) ⬇️
#integration_test_1 35.43% <16.66%> (-0.43%) ⬇️
#integration_test_2 36.04% <13.88%> (-0.28%) ⬇️
#integration_test_3 35.55% <19.44%> (-0.26%) ⬇️
#node_e2e_test 34.08% <0.00%> (+0.12%) ⬆️
#unittest 27.88% <0.00%> (+1.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
daemon/config/config.go 67.25% <61.29%> (-2.26%) ⬇️
apis/server/container_bridge.go 90.60% <100.00%> (+0.05%) ⬆️
daemon/mgr/network.go 73.31% <100.00%> (+0.16%) ⬆️
storage/quota/quota.go 6.45% <0.00%> (-7.75%) ⬇️
daemon/mgr/image_save.go 50.00% <0.00%> (-5.56%) ⬇️
pkg/grpc/interceptor/logging.go 72.97% <0.00%> (-4.81%) ⬇️
daemon/mgr/container_list.go 78.64% <0.00%> (-3.72%) ⬇️
pkg/httputils/client.go 48.93% <0.00%> (-3.07%) ⬇️
apis/server/server.go 58.69% <0.00%> (-2.71%) ⬇️
daemon/mgr/image.go 58.83% <0.00%> (-2.34%) ⬇️
... and 77 more

daemon/mgr/network.go Outdated Show resolved Hide resolved
test/cli_run_network_test.go Outdated Show resolved Hide resolved
daemon/mgr/network.go Outdated Show resolved Hide resolved
daemon/config/config.go Outdated Show resolved Hide resolved
@ZYecho
Copy link
Contributor

ZYecho commented Jun 20, 2019

@lang710 a little suggestion, and also please fix CI issue.

@lang710 lang710 force-pushed the fixaddhost branch 2 times, most recently from 862324e to d3cb90a Compare June 20, 2019 08:05
@pouchrobot pouchrobot added size/XL and removed size/L labels Jun 20, 2019
CONTRIBUTORS Outdated Show resolved Hide resolved
@ZYecho
Copy link
Contributor

ZYecho commented Jul 23, 2019

need rebase

@lang710
Copy link
Contributor Author

lang710 commented Jul 23, 2019

need rebase

Thanks a lot, I'll rebase it as soon as possible.

@CLAassistant
Copy link

CLAassistant commented Jun 12, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Signed-off-by: Lang Chi <21860405@zju.edu.cn>
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.

None yet

4 participants