Skip to content

Commit

Permalink
docs: update log message
Browse files Browse the repository at this point in the history
  • Loading branch information
caroldelwing committed Nov 19, 2024
1 parent ab1ef40 commit 7070e37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/cluster-scanner/internal/search_old_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
8 changes: 4 additions & 4 deletions scripts/cluster-scanner/internal/search_old_clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":{
Expand All @@ -51,16 +51,16 @@ 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":{
input: []*models.V1SpectroClusterSummary{
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":{
Expand Down
1 change: 1 addition & 0 deletions scripts/cluster-scanner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 7070e37

Please sign in to comment.