mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Move StartedAt time to before starting the container
Signed-off-by: Lars Andringa <l.s.andringa@rug.nl> Signed-off-by: LarsSven <l.s.andringa@rug.nl> Replaced boolean parameter by IsZero check Signed-off-by: LarsSven <l.s.andringa@rug.nl> Separated SetRunning into two functions Signed-off-by: LarsSven <l.s.andringa@rug.nl> Apply suggestions from code review Documentation fixes Co-authored-by: Paweł Gronowski <me@woland.xyz> Signed-off-by: LarsSven <l.s.andringa@rug.nl>
This commit is contained in:
@@ -199,6 +199,7 @@ func (daemon *Daemon) containerStart(ctx context.Context, daemonCfg *configStore
|
||||
return setExitCodeFromError(container.SetExitCode, err)
|
||||
}
|
||||
|
||||
startupTime := time.Now()
|
||||
// TODO(mlaventure): we need to specify checkpoint options here
|
||||
tsk, err := ctr.Start(context.TODO(), // Passing ctx to ctr.Start caused integration tests to be stuck in the cleanup phase
|
||||
checkpointDir, container.StreamConfig.Stdin() != nil || container.Config.Tty,
|
||||
@@ -212,7 +213,7 @@ func (daemon *Daemon) containerStart(ctx context.Context, daemonCfg *configStore
|
||||
}
|
||||
|
||||
container.HasBeenManuallyRestarted = false
|
||||
container.SetRunning(ctr, tsk, true)
|
||||
container.SetRunning(ctr, tsk, startupTime)
|
||||
container.HasBeenStartedBefore = true
|
||||
daemon.setStateCounter(container)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user