diff --git a/pkg/analyze/common_status.go b/pkg/analyze/common_status.go index 58b70d0f0..a4cb52955 100644 --- a/pkg/analyze/common_status.go +++ b/pkg/analyze/common_status.go @@ -8,8 +8,10 @@ import ( troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1" ) -func commonStatus(outcomes []*troubleshootv1beta1.Outcome, readyReplicas int) (*AnalyzeResult, error) { - result := &AnalyzeResult{} +func commonStatus(outcomes []*troubleshootv1beta1.Outcome, title string, readyReplicas int) (*AnalyzeResult, error) { + result := &AnalyzeResult{ + Title: title, + } // ordering from the spec is important, the first one that matches returns for _, outcome := range outcomes { diff --git a/pkg/analyze/deployment_status.go b/pkg/analyze/deployment_status.go index ab4bc0d02..0314cc021 100644 --- a/pkg/analyze/deployment_status.go +++ b/pkg/analyze/deployment_status.go @@ -31,10 +31,11 @@ func deploymentStatus(analyzer *troubleshootv1beta1.DeploymentStatus, getCollect if status == nil { // there's not an error, but maybe the requested deployment is not even deployed return &AnalyzeResult{ + Title: fmt.Sprintf("%s Deployment Status", analyzer.Name), IsFail: true, Message: "not found", }, nil } - return commonStatus(analyzer.Outcomes, int(status.ReadyReplicas)) + return commonStatus(analyzer.Outcomes, fmt.Sprintf("%s Status", analyzer.Name), int(status.ReadyReplicas)) } diff --git a/pkg/analyze/statefulset_status.go b/pkg/analyze/statefulset_status.go index 3ec3bc040..0c7b419cb 100644 --- a/pkg/analyze/statefulset_status.go +++ b/pkg/analyze/statefulset_status.go @@ -31,10 +31,11 @@ func statefulsetStatus(analyzer *troubleshootv1beta1.StatefulsetStatus, getColle if status == nil { // there's not an error, but maybe the requested statefulset is not even deployed return &AnalyzeResult{ + Title: fmt.Sprintf("%s Statefulset Status", analyzer.Name), IsFail: true, Message: "not found", }, nil } - return commonStatus(analyzer.Outcomes, int(status.ReadyReplicas)) + return commonStatus(analyzer.Outcomes, fmt.Sprintf("%s Status", analyzer.Name), int(status.ReadyReplicas)) }