runtime: remove unnecessary intermediate type, Status
Signed-off-by: Burcu Dogan <jbd@google.com>
This commit is contained in:
parent
1ade1f6d81
commit
167219101f
5 changed files with 11 additions and 20 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue