From 82b586349c81e071f5e024ecf35ab005ea326df6 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Fri, 2 Aug 2019 10:26:50 +0200 Subject: restore: correctly set StartedTime A container restored from an exported checkpoint did not have its StartedTime set. Which resulted in a status like 'Up 292 years ago' after the restore. This just sets the StartedTime to time.Now() if a container is restored from an exported checkpoint. Signed-off-by: Adrian Reber --- libpod/runtime_ctr.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libpod') diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 47d49f6aa..61a871b28 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -52,6 +52,8 @@ func (r *Runtime) RestoreContainer(ctx context.Context, rSpec *spec.Spec, config if err != nil { return nil, errors.Wrapf(err, "error initializing container variables") } + // For an imported checkpoint no one has ever set the StartedTime. Set it now. + ctr.state.StartedTime = time.Now() return r.setupContainer(ctx, ctr) } -- cgit v1.2.3-54-g00ecf