diff --git a/util/progress/progressui/display.go b/util/progress/progressui/display.go index cc684b597261..c6c723feeb7c 100644 --- a/util/progress/progressui/display.go +++ b/util/progress/progressui/display.go @@ -140,6 +140,9 @@ type vertex struct { count int statusUpdates map[string]struct{} + warnings []client.VertexWarning + warningIdx int + jobs []*job jobCached bool @@ -255,6 +258,14 @@ func (t *trace) update(s *client.SolveStatus, termWidth int) { t.updates[v.Digest] = struct{}{} v.update(1) } + for _, w := range s.Warnings { + v, ok := t.byDigest[w.Vertex] + if !ok { + continue // shouldn't happen + } + v.warnings = append(v.warnings, *w) + v.update(1) + } for _, l := range s.Logs { v, ok := t.byDigest[l.Vertex] if !ok { @@ -369,6 +380,16 @@ func (t *trace) displayInfo() (d displayInfo) { } jobs = append(jobs, j) } + for _, w := range v.warnings { + msg := "WARN: " + string(w.Message) + j := &job{ + startTime: addTime(v.Started, t.localTimeDiff), + completedTime: addTime(v.Completed, t.localTimeDiff), + name: msg, + isCanceled: true, + } + jobs = append(jobs, j) + } d.jobs = append(d.jobs, jobs...) v.jobs = jobs v.jobCached = true diff --git a/util/progress/progressui/printer.go b/util/progress/progressui/printer.go index 11014eb51c55..f02d53c0e70a 100644 --- a/util/progress/progressui/printer.go +++ b/util/progress/progressui/printer.go @@ -125,6 +125,11 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) { } v.statusUpdates = map[string]struct{}{} + for _, w := range v.warnings[v.warningIdx:] { + fmt.Fprintf(p.w, "#%d WARN: %s\n", v.index, w.Message) + v.warningIdx++ + } + for i, l := range v.logs { if i == 0 { l = l[v.logsOffset:]