From 5f522b6ca88d7720ac1ea87de77e055975899b32 Mon Sep 17 00:00:00 2001 From: FUJIWARA Shunichiro Date: Tue, 1 Mar 2022 14:07:01 +0900 Subject: [PATCH] show all status of containers task.StoppedAt is nil when task is not stopped. --- tracer.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tracer.go b/tracer.go index f4fdfbd..daead87 100644 --- a/tracer.go +++ b/tracer.go @@ -245,10 +245,11 @@ func (t *Tracer) traceTask(cluster string, taskID string) (*ecs.Task, error) { msg += fmt.Sprintf(" (reason: %s)", *c.Reason) } var ts *time.Time - if aws.StringValue(c.LastStatus) == "RUNNING" { - ts = &t.now - } else { + switch aws.StringValue(c.LastStatus) { + case "STOPPED": ts = task.StoppedAt + default: + ts = &t.now } t.AddEvent(ts, "CONTAINER:"+containerName, msg) }