diff options
author | Adrian Reber <areber@redhat.com> | 2019-08-02 10:26:50 +0200 |
---|---|---|
committer | Adrian Reber <areber@redhat.com> | 2019-08-05 14:29:07 +0200 |
commit | 82b586349c81e071f5e024ecf35ab005ea326df6 (patch) | |
tree | 792022abe7d510704002d2231d0fdd3746fde1ae /libpod | |
parent | 2cc5913bed1fb16690eb27c6e636867a5946070e (diff) | |
download | podman-82b586349c81e071f5e024ecf35ab005ea326df6.tar.gz podman-82b586349c81e071f5e024ecf35ab005ea326df6.tar.bz2 podman-82b586349c81e071f5e024ecf35ab005ea326df6.zip |
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 <areber@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime_ctr.go | 2 |
1 files changed, 2 insertions, 0 deletions
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) } |