Skip to content

Commit 45c7d95

Browse files
authored
Merge pull request #140 from GraysonNull/grayson/icon-uri
add IconURI to insights
2 parents 2eb6518 + 42288a4 commit 45c7d95

15 files changed

+21
-3
lines changed

pkg/analyze/analyzer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type AnalyzeResult struct {
1414
Message string
1515
URI string
1616
IconKey string
17+
IconURI string
1718
}
1819

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

pkg/analyze/cluster_version.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func analyzeClusterVersionResult(k8sVersion semver.Version, outcomes []*troubles
4343
result := AnalyzeResult{
4444
Title: title,
4545
IconKey: "kubernetes_cluster_version",
46+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/kubernetes.svg?w=16&h=16",
4647
}
4748

4849
if outcome.Fail != nil {

pkg/analyze/common_status.go

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

11-
func commonStatus(outcomes []*troubleshootv1beta1.Outcome, title, iconKey string, readyReplicas int) (*AnalyzeResult, error) {
11+
func commonStatus(outcomes []*troubleshootv1beta1.Outcome, title, iconKey string, iconURI string, readyReplicas int) (*AnalyzeResult, error) {
1212
result := &AnalyzeResult{
1313
Title: title,
1414
IconKey: iconKey,
15+
IconURI: iconURI,
1516
}
1617

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

pkg/analyze/container_runtime.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func analyzeContainerRuntime(analyzer *troubleshootv1beta1.ContainerRuntime, get
2929
result := &AnalyzeResult{
3030
Title: "Container Runtime",
3131
IconKey: "kubernetes_container_runtime",
32+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/container-runtime.svg?w=23&h=16",
3233
}
3334

3435
// ordering is important for passthrough

pkg/analyze/crd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func analyzeCustomResourceDefinition(analyzer *troubleshootv1beta1.CustomResourc
2727
result := AnalyzeResult{
2828
Title: title,
2929
IconKey: "kubernetes_custom_resource_definition",
30+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/custom-resource-definition.svg?w=13&h=16",
3031
}
3132

3233
for _, storageClass := range crds {

pkg/analyze/deployment_status.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ func analyzeDeploymentStatus(analyzer *troubleshootv1beta1.DeploymentStatus, get
3333
return &AnalyzeResult{
3434
Title: fmt.Sprintf("%s Deployment Status", analyzer.Name),
3535
IconKey: "kubernetes_deployment_status",
36+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17",
3637
IsFail: true,
3738
Message: fmt.Sprintf("The deployment %q was not found", analyzer.Name),
3839
}, nil
3940
}
4041

41-
return commonStatus(analyzer.Outcomes, fmt.Sprintf("%s Status", analyzer.Name), "kubernetes_deployment_status", int(status.ReadyReplicas))
42+
return commonStatus(analyzer.Outcomes, fmt.Sprintf("%s Status", analyzer.Name), "kubernetes_deployment_status", "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17", int(status.ReadyReplicas))
4243
}

pkg/analyze/distribution.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
102102
result := &AnalyzeResult{
103103
Title: "Kubernetes Distribution",
104104
IconKey: "kubernetes_distribution",
105+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/distribution.svg?w=20&h=14",
105106
}
106107

107108
// 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
@@ -26,6 +26,7 @@ func analyzeImagePullSecret(analyzer *troubleshootv1beta1.ImagePullSecret, getCh
2626
result := AnalyzeResult{
2727
Title: analyzer.CheckName,
2828
IconKey: "kubernetes_image_pull_secret",
29+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/image-pull-secret.svg?w=16&h=14",
2930
IsFail: true,
3031
Message: failOutcome.Fail.Message,
3132
URI: failOutcome.Fail.URI,

pkg/analyze/ingress.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func analyzeIngress(analyzer *troubleshootv1beta1.Ingress, getCollectedFileConte
2727
result := AnalyzeResult{
2828
Title: title,
2929
IconKey: "kubernetes_ingress",
30+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/ingress-controller.svg?w=20&h=13",
3031
}
3132

3233
for _, ingress := range ingresses {

pkg/analyze/node_resources.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func analyzeNodeResources(analyzer *troubleshootv1beta1.NodeResources, getCollec
4545
result := &AnalyzeResult{
4646
Title: title,
4747
IconKey: "kubernetes_node_resources",
48+
IconURI: "https://troubleshoot.sh/images/analyzer-icons/node-resources.svg?w=16&h=18",
4849
}
4950

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

0 commit comments

Comments
 (0)