Wait ensures that the app service containers are healthy.
(requiredContainers []string)
| 3032 | |
| 3033 | // Wait ensures that the app service containers are healthy. |
| 3034 | func (app *DdevApp) Wait(requiredContainers []string) error { |
| 3035 | for _, containerType := range requiredContainers { |
| 3036 | labels := map[string]string{ |
| 3037 | "com.ddev.site-name": app.GetName(), |
| 3038 | "com.docker.compose.service": containerType, |
| 3039 | "com.docker.compose.oneoff": "False", |
| 3040 | } |
| 3041 | waitTime := app.GetMaxContainerWaitTime() |
| 3042 | logOutput, err := dockerutil.ContainerWait(waitTime, labels) |
| 3043 | if err != nil { |
| 3044 | return fmt.Errorf("%s container failed: log=%s, err=%v", containerType, logOutput, err) |
| 3045 | } |
| 3046 | } |
| 3047 | |
| 3048 | return nil |
| 3049 | } |
| 3050 | |
| 3051 | // WaitByLabels waits for containers found by list of labels to be |
| 3052 | // ready |