Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
RidRisR committed Jan 10, 2025
1 parent 4bc8740 commit 26a59d2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/e2e/br/framework/br/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"context"
"encoding/binary"
"fmt"
"os"
"path"
"sort"
"time"
Expand Down Expand Up @@ -364,20 +363,19 @@ func WaitForCompactComplete(f *framework.Framework, ns, name string, timeout tim
if err != nil {
log.Logf("Error listing events: %v", err)
}

if len(events.Items) == 0 {
fmt.Printf("No events found for pod %s in namespace %s\n", name, ns)
os.Exit(0)
}

sort.Slice(events.Items, func(i, j int) bool {
timeI := events.Items[i].LastTimestamp.Time
timeJ := events.Items[j].LastTimestamp.Time
return timeI.After(timeJ)
})

latestEvent := events.Items[0]

log.Logf("Type: %s\n", latestEvent.Type)
log.Logf("Reason: %s\n", latestEvent.Reason)
log.Logf("Message: %s\n", latestEvent.Message)
Expand Down

0 comments on commit 26a59d2

Please sign in to comment.