add error type for check running

pull/8501/head
Medya Gh 2020-06-16 17:07:36 -07:00
parent c8b6ceaffc
commit 736f5219e0
2 changed files with 4 additions and 1 deletions

View File

@ -26,3 +26,6 @@ var ErrWindowsContainers = FailFastError(errors.New("docker container type is wi
// ErrCPUCountLimit is thrown when docker daemon doesn't have enough CPUs for the requested container
var ErrCPUCountLimit = FailFastError(errors.New("not enough CPUs is available for container"))
// ErrNotRunningAfterCreate is thrown when container is created without error but it exists and it's status is not running
var ErrNotRunningAfterCreate = errors.New("container status is not running after creation")

View File

@ -218,7 +218,7 @@ func CreateContainerNode(p CreateParams) error {
// retry up to up 13 seconds to make sure the created container status is running.
if err := retry.Expo(checkRunning, 13*time.Millisecond, time.Second*13); err != nil {
return errors.Wrapf(err, "check container %q running", p.Name)
return errors.Wrapf(ErrNotRunningAfterCreate, "container name %q", p.Name)
}
return nil