add 'no matching files' analyze result

This commit is contained in:
Andrew Lavery
2020-04-15 19:17:01 -04:00
parent 45ccd7be5b
commit 079765b558

View File

@@ -22,6 +22,18 @@ func analyzeTextAnalyze(analyzer *troubleshootv1beta1.TextAnalyze, getCollectedF
checkName = analyzer.CollectorName
}
if len(collected) == 0 {
return []*AnalyzeResult{
{
Title: checkName,
IconKey: "kubernetes_text_analyze",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg",
IsFail: false,
Message: "No matching files",
},
}, nil
}
results := []*AnalyzeResult{}
if analyzer.RegexPattern != "" {