From 97db83b270d9fcf85363629eda39895dd0c562af Mon Sep 17 00:00:00 2001 From: Matias Manavella Date: Tue, 18 Aug 2020 13:57:53 -0300 Subject: [PATCH] checkName in Distribution and Runtime --- pkg/analyze/container_runtime.go | 6 +++++- pkg/analyze/distribution.go | 7 +++++-- pkg/analyze/image_pull_secret.go | 6 +++++- pkg/analyze/mysql.go | 8 ++++---- pkg/analyze/postgres.go | 8 ++++---- pkg/analyze/redis.go | 8 ++++---- 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/pkg/analyze/container_runtime.go b/pkg/analyze/container_runtime.go index 22843811..86de8900 100644 --- a/pkg/analyze/container_runtime.go +++ b/pkg/analyze/container_runtime.go @@ -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", } diff --git a/pkg/analyze/distribution.go b/pkg/analyze/distribution.go index 1109cbb9..6dc8c5f4 100644 --- a/pkg/analyze/distribution.go +++ b/pkg/analyze/distribution.go @@ -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", } diff --git a/pkg/analyze/image_pull_secret.go b/pkg/analyze/image_pull_secret.go index 8571f88c..0792d929 100644 --- a/pkg/analyze/image_pull_secret.go +++ b/pkg/analyze/image_pull_secret.go @@ -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, diff --git a/pkg/analyze/mysql.go b/pkg/analyze/mysql.go index ea9e0fb4..5426d4c8 100644 --- a/pkg/analyze/mysql.go +++ b/pkg/analyze/mysql.go @@ -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", } diff --git a/pkg/analyze/postgres.go b/pkg/analyze/postgres.go index 4cf285c8..8be4c304 100644 --- a/pkg/analyze/postgres.go +++ b/pkg/analyze/postgres.go @@ -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", } diff --git a/pkg/analyze/redis.go b/pkg/analyze/redis.go index c2c1af4d..b92e40da 100644 --- a/pkg/analyze/redis.go +++ b/pkg/analyze/redis.go @@ -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", }