From e1752be302320016538ba1d6faa77721f6c42f68 Mon Sep 17 00:00:00 2001 From: GMHDBJD <35025882+GMHDBJD@users.noreply.github.com> Date: Thu, 11 Jun 2020 03:50:56 -0400 Subject: [PATCH] check-task: do not show successful pre-check items if fail(#712) (#730) --- checker/checker.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/checker/checker.go b/checker/checker.go index ff922ebbaa..99774176f8 100644 --- a/checker/checker.go +++ b/checker/checker.go @@ -255,6 +255,15 @@ func (c *Checker) Process(ctx context.Context, pr chan pb.ProcessResult) { errs = append(errs, unit.NewProcessError(pb.ErrorType_CheckFailed, err)) } else if !result.Summary.Passed { errs = append(errs, unit.NewProcessError(pb.ErrorType_CheckFailed, errors.New("check was failed, please see detail"))) + + // remove success result if not pass + results := result.Results[:0] + for _, r := range result.Results { + if r.State != check.StateSuccess { + results = append(results, r) + } + } + result.Results = results } c.updateInstruction(result)