Skip to content

Commit

Permalink
docs: improve log message, add emojis
Browse files Browse the repository at this point in the history
  • Loading branch information
caroldelwing committed Dec 24, 2024
1 parent 5aaeed7 commit 04561ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cluster_scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Get Clusters with More Than 24 Hours and Format Output
working-directory: scripts/cluster-scanner
run: |
if grep -q "The following clusters have been running for more than 24 hours" result.log; then
if grep -q "The following clusters have been running" result.log; then
echo "CLUSTERS_FOUND=true" >> $GITHUB_ENV
{
echo 'LOG_MESSAGE<<EOF'
Expand All @@ -58,7 +58,6 @@ jobs:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_PRIVATE_TEAM_WEBHOOK }}
SLACK_USERNAME: "spectromate"
SLACK_ICON_EMOJI: ":clock1:"
SLACK_COLOR: "good"
SLACKIFY_MARKDOWN: true
ENABLE_ESCAPES: true
Expand Down
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("-'%s' cluster (%s) - %s", cluster.Metadata.Name, cluster.SpecSummary.CloudConfig.CloudType, *age)
message := fmt.Sprintf("❗️%s cluster '%s' - %s", cluster.SpecSummary.CloudConfig.CloudType, cluster.Metadata.Name, *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 @@ -43,7 +43,7 @@ func TestSearchOldClusters (t *testing.T) {
createSummary("-30h", "test-cluster", "aws"),
},
output: []string{
"-'test-cluster' cluster (aws) - 1 days 6 hours",
"❗️aws cluster 'test-cluster' - 1 days 6 hours",
},
},
"two clusters older than 24h":{
Expand All @@ -52,16 +52,16 @@ func TestSearchOldClusters (t *testing.T) {
createSummary("-50h", "test-cluster-azure", "azure"),
},
output: []string{
"-'test-cluster' cluster (aws) - 1 days 6 hours",
"-'test-cluster-azure' cluster (azure) - 2 days 2 hours",
"❗️aws cluster 'test-cluster' - 1 days 6 hours",
"❗️azure cluster 'test-cluster-azure' - 2 days 2 hours",
},
},
"one cluster with 24h":{
input: []*models.V1SpectroClusterSummary{
createSummary("-24h", "test-cluster", "aws"),
},
output: []string{
"-'test-cluster' cluster (aws) - 1 days ",
"❗️aws cluster 'test-cluster' - 1 days ",
},
},
"one cluster with less than 24h":{
Expand Down
2 changes: 1 addition & 1 deletion scripts/cluster-scanner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +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.")
logger.Info("The following clusters have been running for over 24 hours. Please delete them if they're no longer needed:")
for _, message := range messageArray {
logger.Info(message)
}
Expand Down

0 comments on commit 04561ee

Please sign in to comment.