Add id to state command to return single container
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
58c5eb5ecb
commit
76d69b4ed8
8 changed files with 100 additions and 78 deletions
|
@ -5,6 +5,14 @@ type GetContainersEvent struct {
|
|||
}
|
||||
|
||||
func (h *GetContainersEvent) Handle(e *Event) error {
|
||||
if e.ID != "" {
|
||||
ci := h.s.containers[e.ID]
|
||||
if ci == nil {
|
||||
return ErrContainerNotFound
|
||||
}
|
||||
e.Containers = append(e.Containers, ci.container)
|
||||
return nil
|
||||
}
|
||||
for _, i := range h.s.containers {
|
||||
e.Containers = append(e.Containers, i.container)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue