From 7ab51d1eb8cbae2358c8a98ce5b9c6ecc0ba0613 Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Tue, 15 Aug 2023 16:32:47 -0700 Subject: [PATCH] Sort event list 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 2a328173..82657201 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 {