Not showing up the events for destroyed container

Signed-off-by: rajasec <rajasec79@gmail.com>

Updated as per review comments by moving to caller

Signed-off-by: rajasec <rajasec79@gmail.com>
This commit is contained in:
rajasec 2016-04-20 20:33:39 +05:30
parent ae0fc15b1e
commit fb53190389
1 changed files with 8 additions and 0 deletions

View File

@ -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)