Skip to content

Commit 016d6e4

Browse files
authored
Merge pull request #246 from manavellamnimble/add_checkNames
checkName in Distribution and Runtime
2 parents 20e82be + 97db83b commit 016d6e4

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

pkg/analyze/container_runtime.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ func analyzeContainerRuntime(analyzer *troubleshootv1beta1.ContainerRuntime, get
2626
foundRuntimes = append(foundRuntimes, node.Status.NodeInfo.ContainerRuntimeVersion)
2727
}
2828

29+
title := analyzer.CheckName
30+
if title == "" {
31+
title = "Container Runtime"
32+
}
2933
result := &AnalyzeResult{
30-
Title: "Container Runtime",
34+
Title: title,
3135
IconKey: "kubernetes_container_runtime",
3236
IconURI: "https://troubleshoot.sh/images/analyzer-icons/container-runtime.svg?w=23&h=16",
3337
}

pkg/analyze/distribution.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,12 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
123123
}
124124
_ = CheckOpenShift(&foundProviders, apiResources, "")
125125
}
126-
126+
title := analyzer.CheckName
127+
if title == "" {
128+
title = "Kubernetes Distribution"
129+
}
127130
result := &AnalyzeResult{
128-
Title: "Kubernetes Distribution",
131+
Title: title,
129132
IconKey: "kubernetes_distribution",
130133
IconURI: "https://troubleshoot.sh/images/analyzer-icons/distribution.svg?w=20&h=14",
131134
}

pkg/analyze/image_pull_secret.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ func analyzeImagePullSecret(analyzer *troubleshootv1beta1.ImagePullSecret, getCh
2222
passOutcome = outcome
2323
}
2424
}
25+
title := analyzer.CheckName
26+
if title == "" {
27+
title = "Image Pull Secrets"
28+
}
2529

2630
result := AnalyzeResult{
27-
Title: analyzer.CheckName,
31+
Title: title,
2832
IconKey: "kubernetes_image_pull_secret",
2933
IconURI: "https://troubleshoot.sh/images/analyzer-icons/image-pull-secret.svg?w=16&h=14",
3034
IsFail: true,

pkg/analyze/mysql.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ func analyzeMysql(analyzer *troubleshootv1beta1.DatabaseAnalyze, getCollectedFil
2828
return nil, errors.Wrap(err, "failed to unmarshal databased connection result")
2929
}
3030

31-
checkName := analyzer.CheckName
32-
if checkName == "" {
33-
checkName = collectorName
31+
title := analyzer.CheckName
32+
if title == "" {
33+
title = collectorName
3434
}
3535

3636
result := &AnalyzeResult{
37-
Title: checkName,
37+
Title: title,
3838
IconKey: "kubernetes_mysql_analyze",
3939
IconURI: "https://troubleshoot.sh/images/analyzer-icons/mysql-analyze.svg",
4040
}

pkg/analyze/postgres.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ func analyzePostgres(analyzer *troubleshootv1beta1.DatabaseAnalyze, getCollected
2828
return nil, errors.Wrap(err, "failed to unmarshal databased connection result")
2929
}
3030

31-
checkName := analyzer.CheckName
32-
if checkName == "" {
33-
checkName = collectorName
31+
title := analyzer.CheckName
32+
if title == "" {
33+
title = collectorName
3434
}
3535

3636
result := &AnalyzeResult{
37-
Title: checkName,
37+
Title: title,
3838
IconKey: "kubernetes_postgres_analyze",
3939
IconURI: "https://troubleshoot.sh/images/analyzer-icons/postgres-analyze.svg",
4040
}

pkg/analyze/redis.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ func analyzeRedis(analyzer *troubleshootv1beta1.DatabaseAnalyze, getCollectedFil
2828
return nil, errors.Wrap(err, "failed to unmarshal database connection result")
2929
}
3030

31-
checkName := analyzer.CheckName
32-
if checkName == "" {
33-
checkName = collectorName
31+
title := analyzer.CheckName
32+
if title == "" {
33+
title = collectorName
3434
}
3535

3636
result := &AnalyzeResult{
37-
Title: checkName,
37+
Title: title,
3838
IconKey: "kubernetes_redis_analyze",
3939
IconURI: "https://troubleshoot.sh/images/analyzer-icons/redis-analyze.svg",
4040
}

0 commit comments

Comments
 (0)