Skip to content

Commit

Permalink
check Default SC
Browse files Browse the repository at this point in the history
  • Loading branch information
manavellamnimble committed Sep 1, 2020
1 parent f7e4103 commit 8b1ae01
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/analyze/storage_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ func analyzeStorageClass(analyzer *troubleshootv1beta1.StorageClass, getCollecte

title := analyzer.CheckName
if title == "" {
title = fmt.Sprintf("Storage class %s", analyzer.StorageClassName)
if analyzer.StorageClassName != "" {
title = fmt.Sprintf("Storage class %s", analyzer.StorageClassName)
} else {
title = "Default Storage class"
}
}

result := AnalyzeResult{
Expand All @@ -40,6 +44,9 @@ func analyzeStorageClass(analyzer *troubleshootv1beta1.StorageClass, getCollecte
result.URI = outcome.Pass.URI
}
}
if analyzer.StorageClassName == "" && result.Message == "" {
result.Message = "Default Storage found"
}

return &result, nil
}
Expand All @@ -52,6 +59,9 @@ func analyzeStorageClass(analyzer *troubleshootv1beta1.StorageClass, getCollecte
result.URI = outcome.Fail.URI
}
}
if analyzer.StorageClassName == "" && result.Message == "" {
result.Message = "Default Storage not found"
}

return &result, nil
}

0 comments on commit 8b1ae01

Please sign in to comment.