WaitForReady waits for the operator deployment to be ready. If checkWebhook is true, it will also check that the webhook is replying
( ctx context.Context, crudClient client.Client, timeoutSeconds uint, checkWebhook bool, )
| 208 | // WaitForReady waits for the operator deployment to be ready. |
| 209 | // If checkWebhook is true, it will also check that the webhook is replying |
| 210 | func WaitForReady( |
| 211 | ctx context.Context, |
| 212 | crudClient client.Client, |
| 213 | timeoutSeconds uint, |
| 214 | checkWebhook bool, |
| 215 | ) error { |
| 216 | return retry.New(retry.Delay(time.Second), |
| 217 | retry.Attempts(timeoutSeconds)). |
| 218 | Do( |
| 219 | func() error { |
| 220 | ready, err := IsReady(ctx, crudClient, checkWebhook) |
| 221 | if err != nil || !ready { |
| 222 | return fmt.Errorf("operator deployment is not ready") |
| 223 | } |
| 224 | return nil |
| 225 | }, |
| 226 | ) |
| 227 | } |
| 228 | |
| 229 | // isDeploymentReady returns true if the operator deployment has the expected number |
| 230 | // of ready pods. |
no test coverage detected