-
Notifications
You must be signed in to change notification settings - Fork 944
feature: support dns related flags when creating container through pouch cli #2380
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2380 +/- ##
==========================================
- Coverage 68.45% 68.44% -0.02%
==========================================
Files 275 275
Lines 18291 18245 -46
==========================================
- Hits 12522 12488 -34
+ Misses 4340 4335 -5
+ Partials 1429 1422 -7
|
test/cli_run_dns_test.go
Outdated
| inspectRes := command.PouchRun("inspect", cname) | ||
| res.Assert(c, icmd.Success) | ||
|
|
||
| result := []types.ContainerJSON{} |
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 add a util func named inspectFilter in pr #2372 , use it to instead of unmarshal?
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, please rebase this pr to the latest master. And do as @ZYecho said.
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.
Rebased. And fixed as ZYecho said. @allencloud
test/cli_run_dns_test.go
Outdated
|
|
||
| // test if the value is in inspect result | ||
| inspectRes := command.PouchRun("inspect", cname) | ||
| res.Assert(c, icmd.Success) |
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.
inspectRes.Assert(c, icmd.Success)?
| busyboxImage, | ||
| "cat", "/etc/resolv.conf") | ||
| defer DelContainerForceMultyTime(c, cname) | ||
| res.Assert(c, icmd.Success) |
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's a good chioce to put command.PouchRun and Assert into one line? Since the res var didn't use after this.
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 saw the behavior was divergent in the cli test.
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.
@ZYecho Fixed.
LGTM, but waiting for the CI pass.
test/cli_run_dns_test.go
Outdated
| res.Assert(c, icmd.Success) | ||
|
|
||
| result := []types.ContainerJSON{} | ||
| if err := json.Unmarshal([]byte(inspectRes.Stdout()), &result); 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.
same with above.
|
Could you squash the two commits into a single one? @mathspanda |
|
Sorry. "123" is just a test commit. I will squash them. @allencloud |
|
@ZYecho Fixed. |
30e9dfe to
ec0f322
Compare
| func (suite *PouchRunDNSSuite) TestRunWithDNSFlags(c *check.C) { | ||
| cname := "TestRunWithDNSFlags" | ||
|
|
||
| res := command.PouchRun("run", "--name", cname, |
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.
since res not used, how about command.PouchRun(xx).(c, icmd.Success)
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.
Nope. res is used in line 84.
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.
OK, got it , my mistake
…uch cli Signed-off-by: mathspanda <[email protected]>
|
LGTM |
Signed-off-by: mathspanda [email protected]
Ⅰ. Describe what this PR did
Support dns related flags for pouch cli: dns, dns-option and dns-search.
Ⅱ. Does this pull request fix one issue?
Fix #2356
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
None
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
None