Compare commits

..
1 Commits
Author SHA1 Message Date
Kyle Sorensen 2977f8f0d3 Stop longhorn false positives on no results. (#397)
Longhorn analyzer no longer report positive results on no results
2021-07-28 09:37:54 -06:00
2 changed files with 8 additions and 2 deletions
+3 -2
View File
@@ -247,15 +247,16 @@ func analyzeLonghornReplicaChecksums(volumeName string, checksums []map[string]s
// Keep warn/error results. Return a single pass result if there are no warn/errors.
func simplifyLonghornResults(results []*AnalyzeResult) []*AnalyzeResult {
out := []*AnalyzeResult{}
resultPass := false
for _, result := range results {
if result.IsPass {
resultPass = true
continue
}
out = append(out, result)
}
if len(out) == 0 {
if resultPass && len(out) == 0 {
out = append(out, &AnalyzeResult{
Title: "Longhorn Health Status",
IsPass: true,
+5
View File
@@ -411,6 +411,11 @@ func TestSimplifyLonghornResults(t *testing.T) {
},
},
},
{
name: "No Results",
input: []*AnalyzeResult{},
expect: []*AnalyzeResult{},
},
{
name: "Mixed results",
input: []*AnalyzeResult{