Runs retryFunc until no error is returned. After dur time the last error is returned. Note that the function does not timeout the execution of retryFunc when the limit is reached.
(retryFunc func() error, dur time.Duration)
| 465 | // Runs retryFunc until no error is returned. After dur time the last error is returned. |
| 466 | // Note that the function does not timeout the execution of retryFunc when the limit is reached. |
| 467 | func RetryForDuration(retryFunc func() error, dur time.Duration) error { |
| 468 | waitUntil := time.Now().Add(dur) |
| 469 | var err error |
| 470 | for time.Now().Before(waitUntil) { |
| 471 | err = retryFunc() |
| 472 | if err == nil { |
| 473 | return nil |
| 474 | } |
| 475 | } |
| 476 | return err |
| 477 | } |
| 478 | |
| 479 | // CRI-O pod sandbox configuration for crictl |
| 480 | type crioPodConfig struct { |
searching dependent graphs…