Skip to content

Commit 1c79403

Browse files
committed
New icons for analyzers
1 parent b466188 commit 1c79403

15 files changed

+32
-17
lines changed

pkg/analyze/analyzer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type AnalyzeResult struct {
1313
Title string
1414
Message string
1515
URI string
16+
IconKey string
1617
}
1718

1819
type getCollectedFileContents func(string) ([]byte, error)

pkg/analyze/cluster_version.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ func analyzeClusterVersion(analyzer *troubleshootv1beta1.ClusterVersion, getColl
3030
}
3131

3232
func analyzeClusterVersionResult(k8sVersion semver.Version, outcomes []*troubleshootv1beta1.Outcome, checkName string) (*AnalyzeResult, error) {
33-
result := AnalyzeResult{}
3433
for _, outcome := range outcomes {
3534
when := ""
3635
message := ""
@@ -41,8 +40,9 @@ func analyzeClusterVersionResult(k8sVersion semver.Version, outcomes []*troubles
4140
title = "Required Kubernetes Version"
4241
}
4342

44-
result = AnalyzeResult{
45-
Title: title,
43+
result := AnalyzeResult{
44+
Title: title,
45+
IconKey: "kubernetes_cluster_version",
4646
}
4747

4848
if outcome.Fail != nil {

pkg/analyze/common_status.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import (
88
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
99
)
1010

11-
func commonStatus(outcomes []*troubleshootv1beta1.Outcome, title string, readyReplicas int) (*AnalyzeResult, error) {
11+
func commonStatus(outcomes []*troubleshootv1beta1.Outcome, title, iconKey string, readyReplicas int) (*AnalyzeResult, error) {
1212
result := &AnalyzeResult{
13-
Title: title,
13+
Title: title,
14+
IconKey: iconKey,
1415
}
1516

1617
// ordering from the spec is important, the first one that matches returns

pkg/analyze/container_runtime.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ func analyzeContainerRuntime(analyzer *troubleshootv1beta1.ContainerRuntime, get
2727
}
2828

2929
result := &AnalyzeResult{
30-
Title: "Container Runtime",
30+
Title: "Container Runtime",
31+
IconKey: "kubernetes_container_runtime",
3132
}
3233

3334
// ordering is important for passthrough

pkg/analyze/crd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ func analyzeCustomResourceDefinition(analyzer *troubleshootv1beta1.CustomResourc
2525
}
2626

2727
result := AnalyzeResult{
28-
Title: title,
28+
Title: title,
29+
IconKey: "kubernetes_custom_resource_definition",
2930
}
3031

3132
for _, storageClass := range crds {

pkg/analyze/deployment_status.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ func analyzeDeploymentStatus(analyzer *troubleshootv1beta1.DeploymentStatus, get
3232
// there's not an error, but maybe the requested deployment is not even deployed
3333
return &AnalyzeResult{
3434
Title: fmt.Sprintf("%s Deployment Status", analyzer.Name),
35+
IconKey: "kubernetes_deployment_status",
3536
IsFail: true,
3637
Message: fmt.Sprintf("The deployment %q was not found", analyzer.Name),
3738
}, nil
3839
}
3940

40-
return commonStatus(analyzer.Outcomes, fmt.Sprintf("%s Status", analyzer.Name), int(status.ReadyReplicas))
41+
return commonStatus(analyzer.Outcomes, fmt.Sprintf("%s Status", analyzer.Name), "kubernetes_deployment_status", int(status.ReadyReplicas))
4142
}

pkg/analyze/distribution.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
9595
}
9696

9797
result := &AnalyzeResult{
98-
Title: "Kubernetes Distribution",
98+
Title: "Kubernetes Distribution",
99+
IconKey: "kubernetes_distribution",
99100
}
100101

101102
// ordering is important for passthrough

pkg/analyze/image_pull_secret.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func analyzeImagePullSecret(analyzer *troubleshootv1beta1.ImagePullSecret, getCh
2525

2626
result := AnalyzeResult{
2727
Title: analyzer.CheckName,
28+
IconKey: "kubernetes_image_pull_secret",
2829
IsFail: true,
2930
Message: failOutcome.Fail.Message,
3031
URI: failOutcome.Fail.URI,

pkg/analyze/ingress.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ func analyzeIngress(analyzer *troubleshootv1beta1.Ingress, getCollectedFileConte
2525
}
2626

2727
result := AnalyzeResult{
28-
Title: title,
28+
Title: title,
29+
IconKey: "kubernetes_ingress",
2930
}
3031

3132
for _, ingress := range ingresses {

pkg/analyze/node_resources.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ func analyzeNodeResources(analyzer *troubleshootv1beta1.NodeResources, getCollec
4343
}
4444

4545
result := &AnalyzeResult{
46-
Title: title,
46+
Title: title,
47+
IconKey: "kubernetes_node_resources",
4748
}
4849

4950
for _, outcome := range analyzer.Outcomes {

0 commit comments

Comments
 (0)