Skip to content

Commit

Permalink
checkName in Distribution and Runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
manavellamnimble committed Aug 18, 2020
1 parent a686e47 commit 97db83b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 16 deletions.
6 changes: 5 additions & 1 deletion pkg/analyze/container_runtime.go
Expand Up @@ -26,8 +26,12 @@ func analyzeContainerRuntime(analyzer *troubleshootv1beta1.ContainerRuntime, get
foundRuntimes = append(foundRuntimes, node.Status.NodeInfo.ContainerRuntimeVersion)
}

title := analyzer.CheckName
if title == "" {
title = "Container Runtime"
}
result := &AnalyzeResult{
Title: "Container Runtime",
Title: title,
IconKey: "kubernetes_container_runtime",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/container-runtime.svg?w=23&h=16",
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/analyze/distribution.go
Expand Up @@ -123,9 +123,12 @@ func analyzeDistribution(analyzer *troubleshootv1beta1.Distribution, getCollecte
}
_ = CheckOpenShift(&foundProviders, apiResources, "")
}

title := analyzer.CheckName
if title == "" {
title = "Kubernetes Distribution"
}
result := &AnalyzeResult{
Title: "Kubernetes Distribution",
Title: title,
IconKey: "kubernetes_distribution",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/distribution.svg?w=20&h=14",
}
Expand Down
6 changes: 5 additions & 1 deletion pkg/analyze/image_pull_secret.go
Expand Up @@ -22,9 +22,13 @@ func analyzeImagePullSecret(analyzer *troubleshootv1beta1.ImagePullSecret, getCh
passOutcome = outcome
}
}
title := analyzer.CheckName
if title == "" {
title = "Image Pull Secrets"
}

result := AnalyzeResult{
Title: analyzer.CheckName,
Title: title,
IconKey: "kubernetes_image_pull_secret",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/image-pull-secret.svg?w=16&h=14",
IsFail: true,
Expand Down
8 changes: 4 additions & 4 deletions pkg/analyze/mysql.go
Expand Up @@ -28,13 +28,13 @@ func analyzeMysql(analyzer *troubleshootv1beta1.DatabaseAnalyze, getCollectedFil
return nil, errors.Wrap(err, "failed to unmarshal databased connection result")
}

checkName := analyzer.CheckName
if checkName == "" {
checkName = collectorName
title := analyzer.CheckName
if title == "" {
title = collectorName
}

result := &AnalyzeResult{
Title: checkName,
Title: title,
IconKey: "kubernetes_mysql_analyze",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/mysql-analyze.svg",
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/analyze/postgres.go
Expand Up @@ -28,13 +28,13 @@ func analyzePostgres(analyzer *troubleshootv1beta1.DatabaseAnalyze, getCollected
return nil, errors.Wrap(err, "failed to unmarshal databased connection result")
}

checkName := analyzer.CheckName
if checkName == "" {
checkName = collectorName
title := analyzer.CheckName
if title == "" {
title = collectorName
}

result := &AnalyzeResult{
Title: checkName,
Title: title,
IconKey: "kubernetes_postgres_analyze",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/postgres-analyze.svg",
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/analyze/redis.go
Expand Up @@ -28,13 +28,13 @@ func analyzeRedis(analyzer *troubleshootv1beta1.DatabaseAnalyze, getCollectedFil
return nil, errors.Wrap(err, "failed to unmarshal database connection result")
}

checkName := analyzer.CheckName
if checkName == "" {
checkName = collectorName
title := analyzer.CheckName
if title == "" {
title = collectorName
}

result := &AnalyzeResult{
Title: checkName,
Title: title,
IconKey: "kubernetes_redis_analyze",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/redis-analyze.svg",
}
Expand Down

0 comments on commit 97db83b

Please sign in to comment.