From d8fe2ba87ca6d41b15a0e36c0cde0cecd00519bc Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Tue, 15 Aug 2023 18:04:53 -0700 Subject: [PATCH] Sort event list (#584) 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 --- pkg/tool/kubectl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tool/kubectl.go b/pkg/tool/kubectl.go index 2a32817..8265720 100644 --- a/pkg/tool/kubectl.go +++ b/pkg/tool/kubectl.go @@ -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 {