Set container state only once during start
@@ -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
}
