Merge pull request #1396 from harche/cstate

Set container state only once during start
This commit is contained in:
Mrunal Patel 2017-04-17 11:32:42 -07:00 committed by GitHub
commit 97db1eaad9
1 changed files with 4 additions and 3 deletions

View File

@ -263,9 +263,6 @@ func (c *linuxContainer) start(process *Process, isInit bool) error {
}
// generate a timestamp indicating when the container was started
c.created = time.Now().UTC()
c.state = &runningState{
c: c,
}
if isInit {
c.state = &createdState{
c: c,
@ -292,6 +289,10 @@ func (c *linuxContainer) start(process *Process, isInit bool) error {
}
}
}
} else {
c.state = &runningState{
c: c,
}
}
return nil
}