Skip to content

Commit 1ce5e7b

Browse files
authored
Merge pull request #115 from replicatedhq/divolgin/analyzers
Treat analyzer errors as preflight check fails
2 parents 5f60b1f + 052c932 commit 1ce5e7b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/preflight/cli/run.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
analyzerunner "github.com/replicatedhq/troubleshoot/pkg/analyze"
1818
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
1919
"github.com/replicatedhq/troubleshoot/pkg/collect"
20-
"github.com/replicatedhq/troubleshoot/pkg/logger"
2120
"github.com/spf13/viper"
2221
spin "github.com/tj/go-spin"
2322
"gopkg.in/yaml.v2"
@@ -122,8 +121,11 @@ func runPreflights(v *viper.Viper, arg string) error {
122121
for _, analyzer := range preflight.Spec.Analyzers {
123122
analyzeResult, err := analyzerunner.Analyze(analyzer, getCollectedFileContents, getChildCollectedFileContents)
124123
if err != nil {
125-
logger.Printf("an analyzer failed to run: %v\n", err)
126-
continue
124+
analyzeResult = &analyzerunner.AnalyzeResult{
125+
IsFail: true,
126+
Title: "Analyzer Failed",
127+
Message: err.Error(),
128+
}
127129
}
128130

129131
if analyzeResult != nil {

0 commit comments

Comments
 (0)