Skip to content

Commit

Permalink
Sort event list (#584)
Browse files Browse the repository at this point in the history
It's much easier to see the order of actions when the events are sorted
by lastTimestamp. This adds that flag to the GetEvents function.

Signed-off-by: Joe Julian <[email protected]>
  • Loading branch information
joejulian authored Aug 16, 2023
1 parent 61d02d7 commit d8fe2ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/tool/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (k Kubectl) GetPods(args ...string) ([]string, error) {
func (k Kubectl) GetEvents(namespace string) error {
return k.exec.RunProcess("kubectl",
fmt.Sprintf("--request-timeout=%s", k.timeout),
"get", "events", "--output", "wide", "--namespace", namespace)
"get", "events", "--output", "wide", "--namespace", namespace, "--sort-by", "lastTimestamp")
}

func (k Kubectl) DescribePod(namespace string, pod string) error {
Expand Down

0 comments on commit d8fe2ba

Please sign in to comment.