Merge pull request #94 from rakyll/remove-type

runtime: remove unnecessary intermediate type, Status
This commit is contained in:
Michael Crosby 2016-01-28 17:40:17 -08:00
commit c29728a9b0
5 changed files with 11 additions and 20 deletions

View file

@ -289,19 +289,16 @@ func (c *libcontainerContainer) Pause() error {
}
func (c *libcontainerContainer) State() runtime.State {
s := runtime.State{}
// TODO: what to do with error
state, err := c.c.Status()
if err != nil {
return s
return runtime.State("")
}
switch state {
case libcontainer.Paused, libcontainer.Pausing:
s.Status = runtime.Paused
default:
s.Status = runtime.Running
return runtime.Paused
}
return s
return runtime.State("")
}
func (c *libcontainerContainer) ID() string {