Detect task failures

Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
aiordache 2020-09-30 14:52:53 +02:00
parent 144c403e96
commit d3effd2ead
4 changed files with 126 additions and 17 deletions

View file

@ -21,6 +21,7 @@ import (
"fmt"
"io"
"os"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
@ -60,7 +61,8 @@ func runList(ctx context.Context, opts composeOptions) error {
view := viewFromStackList(stackList)
return formatter.Print(view, opts.Format, os.Stdout, func(w io.Writer) {
for _, stack := range view {
_, _ = fmt.Fprintf(w, "%s\t%s\n", stack.Name, stack.Status)
_, _ = fmt.Fprintf(w, "%s\t%s\n", stack.Name, strings.TrimSpace(
fmt.Sprintf("%s %s", stack.Status, stack.Reason))
}
}, "NAME", "STATUS")
}