Set the started time for a container
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
b145b16ac0
commit
0741159ce8
1 changed files with 6 additions and 1 deletions
|
@ -73,7 +73,11 @@ func (r *Runtime) CreateContainer(c *Container) error {
|
|||
|
||||
// StartContainer starts a container.
|
||||
func (r *Runtime) StartContainer(c *Container) error {
|
||||
return utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, r.path, "start", c.name)
|
||||
if err := utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, r.path, "start", c.name); err != nil {
|
||||
return err
|
||||
}
|
||||
c.state.Started = time.Now()
|
||||
return nil
|
||||
}
|
||||
|
||||
// StopContainer stops a container.
|
||||
|
@ -119,6 +123,7 @@ type Container struct {
|
|||
type ContainerState struct {
|
||||
specs.State
|
||||
Created time.Time `json:"created"`
|
||||
Started time.Time `json:"started"`
|
||||
}
|
||||
|
||||
// NewContainer creates a container object.
|
||||
|
|
Loading…
Reference in a new issue