From 7070e3758787ddf25ce171dd3132fff0ebf23558 Mon Sep 17 00:00:00 2001 From: Carolina Delwing Rosa Date: Mon, 18 Nov 2024 21:33:38 -0500 Subject: [PATCH] docs: update log message --- scripts/cluster-scanner/internal/search_old_clusters.go | 2 +- .../cluster-scanner/internal/search_old_clusters_test.go | 8 ++++---- scripts/cluster-scanner/main.go | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/cluster-scanner/internal/search_old_clusters.go b/scripts/cluster-scanner/internal/search_old_clusters.go index 30130ab..f9fd30b 100644 --- a/scripts/cluster-scanner/internal/search_old_clusters.go +++ b/scripts/cluster-scanner/internal/search_old_clusters.go @@ -24,7 +24,7 @@ func SearchOldClusters(clusters []*models.V1SpectroClusterSummary) ([]string, er if err != nil { return nil, err } - message := fmt.Sprintf("The %s cluster named %s has been running for %s. Are you sure you need this cluster?", cluster.SpecSummary.CloudConfig.CloudType, cluster.Metadata.Name, *age) + message := fmt.Sprintf("-'%s' cluster (%s) - %s", cluster.Metadata.Name, cluster.SpecSummary.CloudConfig.CloudType, *age) messageArray = append(messageArray, message) } } diff --git a/scripts/cluster-scanner/internal/search_old_clusters_test.go b/scripts/cluster-scanner/internal/search_old_clusters_test.go index aa08fae..9997212 100644 --- a/scripts/cluster-scanner/internal/search_old_clusters_test.go +++ b/scripts/cluster-scanner/internal/search_old_clusters_test.go @@ -42,7 +42,7 @@ func TestSearchOldClusters (t *testing.T) { createSummary("-30h", "test-cluster", "aws"), }, output: []string{ - "The aws cluster named test-cluster has been running for 1 days 6 hours. Are you sure you need this cluster?", + "-'test-cluster' cluster (aws) - 1 days 6 hours", }, }, "two clusters older than 24h":{ @@ -51,8 +51,8 @@ func TestSearchOldClusters (t *testing.T) { createSummary("-50h", "test-cluster-azure", "azure"), }, output: []string{ - "The aws cluster named test-cluster has been running for 1 days 6 hours. Are you sure you need this cluster?", - "The azure cluster named test-cluster-azure has been running for 2 days 2 hours. Are you sure you need this cluster?", + "-'test-cluster' cluster (aws) - 1 days 6 hours", + "-'test-cluster-azure' cluster (azure) - 2 days 2 hours", }, }, "one cluster with 24h":{ @@ -60,7 +60,7 @@ func TestSearchOldClusters (t *testing.T) { createSummary("-24h", "test-cluster", "aws"), }, output: []string{ - "The aws cluster named test-cluster has been running for 1 days . Are you sure you need this cluster?", + "-'test-cluster' cluster (aws) - 1 days ", }, }, "one cluster with less than 24h":{ diff --git a/scripts/cluster-scanner/main.go b/scripts/cluster-scanner/main.go index 3e1d736..1db3978 100644 --- a/scripts/cluster-scanner/main.go +++ b/scripts/cluster-scanner/main.go @@ -60,6 +60,7 @@ func main() { os.Exit(2) } if len(messageArray) != 0 { + logger.Info("The following clusters have been running for more than 24 hours. Please delete them if they are no longer needed.") for _, message := range messageArray { logger.Info(message) }