mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.
Remove these imports in preparation of migrating our code to become an
actual go module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
24 lines
900 B
Go
24 lines
900 B
Go
package daemon
|
|
|
|
import (
|
|
"context"
|
|
|
|
containertypes "github.com/docker/docker/api/types/container"
|
|
)
|
|
|
|
// ContainerWait waits until the given container is in a certain state
|
|
// indicated by the given condition. If the container is not found, a nil
|
|
// channel and non-nil error is returned immediately. If the container is
|
|
// found, a status result will be sent on the returned channel once the wait
|
|
// condition is met or if an error occurs waiting for the container (such as a
|
|
// context timeout or cancellation). On a successful wait, the exit code of the
|
|
// container is returned in the status with a non-nil Err() value.
|
|
func (daemon *Daemon) ContainerWait(ctx context.Context, name string, condition containertypes.WaitCondition) (<-chan containertypes.StateStatus, error) {
|
|
cntr, err := daemon.GetContainer(name)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return cntr.Wait(ctx, condition), nil
|
|
}
|