From 1be5d31da20a4cd1635db89a223d996eff24bd00 Mon Sep 17 00:00:00 2001 From: Harshal Patil Date: Tue, 4 Apr 2017 15:08:04 +0530 Subject: [PATCH] Set container state only once during start Signed-off-by: Harshal Patil --- libcontainer/container_linux.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index faecc4683..bdc666f20 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -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 }