Convert ExitStatus to use fn to get details

Instead of requiring callers to read the struct fields to check for an
error, provide the exit results via a function instead which is more
natural.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff
2017-08-21 21:28:37 -04:00
parent 026896ac4c
commit 6ab99edb71
10 changed files with 85 additions and 61 deletions

View File

@@ -218,8 +218,9 @@ func (w *worker) runContainer(ctx context.Context, id string) error {
return err
}
status := <-statusC
if status.Err != nil {
if status.Err == context.DeadlineExceeded || status.Err == context.Canceled {
_, _, err = status.Result()
if err != nil {
if err == context.DeadlineExceeded || err == context.Canceled {
return nil
}
w.failures++