diff --git a/daemon/start.go b/daemon/start.go index 4862969471..483f61b506 100644 --- a/daemon/start.go +++ b/daemon/start.go @@ -107,10 +107,6 @@ func (daemon *Daemon) containerStart(container *container.Container) (err error) } container.ToDisk() daemon.Cleanup(container) - attributes := map[string]string{ - "exitCode": fmt.Sprintf("%d", container.ExitCode), - } - daemon.LogContainerEventWithAttributes(container, "die", attributes) } }() @@ -149,8 +145,6 @@ func (daemon *Daemon) containerStart(container *container.Container) (err error) container.Reset(false) - // start event is logged even on error - daemon.LogContainerEvent(container, "start") return err } diff --git a/integration-cli/docker_cli_events_test.go b/integration-cli/docker_cli_events_test.go index 5562d1d328..8a287141d6 100644 --- a/integration-cli/docker_cli_events_test.go +++ b/integration-cli/docker_cli_events_test.go @@ -93,8 +93,16 @@ func (s *DockerSuite) TestEventsContainerFailStartDie(c *check.C) { dieEvent = true } } - c.Assert(startEvent, checker.True, check.Commentf("Start event not found: %v\n%v", actions, events)) - c.Assert(dieEvent, checker.True, check.Commentf("Die event not found: %v\n%v", actions, events)) + + // Windows platform is different from Linux, it will start container whatever + // so Windows can get start/die event but Linux can't + if daemonPlatform == "windows" { + c.Assert(startEvent, checker.True, check.Commentf("Start event not found: %v\n%v", actions, events)) + c.Assert(dieEvent, checker.True, check.Commentf("Die event not found: %v\n%v", actions, events)) + } else { + c.Assert(startEvent, checker.False, check.Commentf("Start event not expected: %v\n%v", actions, events)) + c.Assert(dieEvent, checker.False, check.Commentf("Die event not expected: %v\n%v", actions, events)) + } } func (s *DockerSuite) TestEventsLimit(c *check.C) {