From fb53190389d54713d6b72fd415508e255424786d Mon Sep 17 00:00:00 2001 From: rajasec Date: Wed, 20 Apr 2016 20:33:39 +0530 Subject: [PATCH 1/2] Not showing up the events for destroyed container Signed-off-by: rajasec Updated as per review comments by moving to caller Signed-off-by: rajasec --- events.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/events.go b/events.go index 777ecea23..352106c62 100644 --- a/events.go +++ b/events.go @@ -37,6 +37,14 @@ information is displayed once every 5 seconds.`, if err != nil { fatal(err) } + id := context.Args().First() + status, err := container.Status() + if err != nil { + fatal(err) + } + if status == libcontainer.Destroyed { + fatalf("container with id %s is not running",id) + } var ( stats = make(chan *libcontainer.Stats, 1) events = make(chan *event, 1024) From 9adc1424049421e073c906727d8db2fc49a83cdf Mon Sep 17 00:00:00 2001 From: rajasec Date: Fri, 22 Apr 2016 20:51:43 +0530 Subject: [PATCH 2/2] Updated as per review comments by moving to caller Signed-off-by: rajasec Changing to container ID as per comments Signed-off-by: rajasec --- events.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/events.go b/events.go index 352106c62..cc12eaef6 100644 --- a/events.go +++ b/events.go @@ -37,13 +37,12 @@ information is displayed once every 5 seconds.`, if err != nil { fatal(err) } - id := context.Args().First() status, err := container.Status() if err != nil { fatal(err) } if status == libcontainer.Destroyed { - fatalf("container with id %s is not running",id) + fatalf("container with id %s is not running", container.ID()) } var ( stats = make(chan *libcontainer.Stats, 1)