diff --git a/command/alloc_status.go b/command/alloc_status.go index a73f3ad9b..06c3cadff 100644 --- a/command/alloc_status.go +++ b/command/alloc_status.go @@ -327,7 +327,8 @@ func (c *AllocStatusCommand) outputTaskStatus(state *api.TaskState) { for i, event := range state.Events { if event.DisplayMessage != "" { formattedTime := formatUnixNanoTime(event.Time) - events[size-i] = fmt.Sprintf("%s|%s|%s", formattedTime, event.Type, event.DisplayMessage) + formattedDisplayMsg := fmt.Sprintf("%s|%s|%s", formattedTime, event.Type, event.DisplayMessage) + events[size-i] = formattedDisplayMsg } else { events[size-i] = buildDisplayMessage(event) } @@ -336,7 +337,7 @@ func (c *AllocStatusCommand) outputTaskStatus(state *api.TaskState) { } func buildDisplayMessage(event *api.TaskEvent) string { - formatedTime := formatUnixNanoTime(event.Time) + formattedTime := formatUnixNanoTime(event.Time) // Build up the description based on the event type. var desc string @@ -447,7 +448,7 @@ func buildDisplayMessage(event *api.TaskEvent) string { } // Reverse order so we are sorted by time - return fmt.Sprintf("%s|%s|%s", formatedTime, event.Type, desc) + return fmt.Sprintf("%s|%s|%s", formattedTime, event.Type, desc) } // outputTaskResources prints the task resources for the passed task and if diff --git a/nomad/node_endpoint.go b/nomad/node_endpoint.go index 6fb75b5d8..7f4265fb9 100644 --- a/nomad/node_endpoint.go +++ b/nomad/node_endpoint.go @@ -827,10 +827,6 @@ func (n *Node) UpdateAlloc(args *structs.AllocUpdateRequest, reply *structs.Gene } // Add this to the batch n.updatesLock.Lock() - now := time.Now().UTC().UnixNano() - for _, alloc := range args.Alloc { - alloc.ModifyTime = now - } n.updates = append(n.updates, args.Alloc...) // Start a new batch if none