4 "github.com/docker/docker/container"
5 "golang.org/x/net/context"
8 // ContainerWait waits until the given container is in a certain state
9 // indicated by the given condition. If the container is not found, a nil
10 // channel and non-nil error is returned immediately. If the container is
11 // found, a status result will be sent on the returned channel once the wait
12 // condition is met or if an error occurs waiting for the container (such as a
13 // context timeout or cancellation). On a successful wait, the exit code of the
14 // container is returned in the status with a non-nil Err() value.
15 func (daemon *Daemon) ContainerWait(ctx context.Context, name string, condition container.WaitCondition) (<-chan container.StateStatus, error) {
16 cntr, err := daemon.GetContainer(name)
21 return cntr.Wait(ctx, condition), nil