-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Show container wait error #755
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
If container wait has failed, show an error from the engine and return an appropriate exit code. This requires engine changes from moby/moby#34999 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #755 +/- ##
==========================================
+ Coverage 50.92% 53.56% +2.63%
==========================================
Files 237 218 -19
Lines 15332 14617 -715
==========================================
+ Hits 7808 7829 +21
+ Misses 7024 6305 -719
+ Partials 500 483 -17 |
|
Looks like we are missing unit test coverage for this function. Would you mind writing a test for the error case and the success case? It should be easy to produce an error using the fake client in |
|
@dnephin test cases added, PTAL |
vdemeester
left a comment
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.
LGTM 🦁
cli/command/container/utils_test.go
Outdated
| } | ||
|
|
||
| client := test.NewFakeCli(&fakeClient{waitFunc: waitFn, Version: api.DefaultVersion}) | ||
| //t.Logf("client version: %v\n", client.ClientVersion()) |
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.
You can remove that one 👼
dnephin
left a comment
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.
LGTM (with the commented out line removed)
cli/command/container/utils_test.go
Outdated
| var res container.ContainerWaitOKBody | ||
|
|
||
| go func() { | ||
| if strings.Contains(cid, "exit-code-42") { |
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.
nit: could use a switch/case
switch {
case strings.Contains(cid, "exit-code-42"):
...
}but not a big deal
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
|
Commits updated as per @vdemeester and @dnephin suggestions; I think it's ready to be merged. |
Show container wait error Upstream-commit: 1620538 Component: cli
If container wait has failed, show an error from the engine and return an appropriate exit code.
This relies on engine changes from moby/moby#34999