Skip to content

Commit

Permalink
Log when analysers fail to match any outcome conditions (#1597)
Browse files Browse the repository at this point in the history
Signed-off-by: Evans Mungai <evans@replicated.com>
  • Loading branch information
banjoh authored Aug 20, 2024
1 parent 8ab2b5e commit ff31f5a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/analyze/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func HostAnalyze(
if err != nil {
return NewAnalyzeResultError(analyzer, errors.Wrap(err, "analyze"))
}

if len(result) == 0 {
klog.Errorf("no outcome matched for %q host analyzer", analyzer.Title())
}

return result
}

Expand Down Expand Up @@ -148,6 +153,10 @@ func Analyze(
results = []*AnalyzeResult{}
}

if len(results) == 0 {
klog.Errorf("no outcome matched for %q analyzer", analyzerInst.Title())
}

return results, nil
}

Expand Down

0 comments on commit ff31f5a

Please sign in to comment.