Update traefik dependencies (docker/docker and related) (#1823)
Update traefik dependencies (docker/docker and related) - Update dependencies - Fix compilation problems - Remove vdemeester/docker-events (in docker api now) - Remove `integration/vendor` - Use `testImport` - update some deps. - regenerate the lock from scratch (after a `glide cc`)
This commit is contained in:
parent
7d178f49b4
commit
b7daa2f3a4
1301 changed files with 21476 additions and 150099 deletions
49
vendor/github.com/docker/libcompose/project/project_containers.go
generated
vendored
Normal file
49
vendor/github.com/docker/libcompose/project/project_containers.go
generated
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
package project
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/docker/libcompose/project/events"
|
||||
)
|
||||
|
||||
// Containers lists the containers for the specified services. Can be filter using
|
||||
// the Filter struct.
|
||||
func (p *Project) Containers(ctx context.Context, filter Filter, services ...string) ([]string, error) {
|
||||
containers := []string{}
|
||||
err := p.forEach(services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) {
|
||||
wrapper.Do(nil, events.NoEvent, events.NoEvent, func(service Service) error {
|
||||
serviceContainers, innerErr := service.Containers(ctx)
|
||||
if innerErr != nil {
|
||||
return innerErr
|
||||
}
|
||||
|
||||
for _, container := range serviceContainers {
|
||||
running := container.IsRunning(ctx)
|
||||
switch filter.State {
|
||||
case Running:
|
||||
if !running {
|
||||
continue
|
||||
}
|
||||
case Stopped:
|
||||
if running {
|
||||
continue
|
||||
}
|
||||
case AnyState:
|
||||
// Don't do a thing
|
||||
default:
|
||||
// Invalid state filter
|
||||
return fmt.Errorf("Invalid container filter: %s", filter.State)
|
||||
}
|
||||
containerID := container.ID()
|
||||
containers = append(containers, containerID)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return containers, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue