diff --git a/pkg/types/conf.go b/pkg/types/conf.go index 8295bd9c6..7fba78ebf 100644 --- a/pkg/types/conf.go +++ b/pkg/types/conf.go @@ -615,6 +615,21 @@ func CheckSystemNamespaces(namespace string, systemNamespaces []string) bool { // GetReadinessIndicatorFile waits for readinessIndicatorFile func GetReadinessIndicatorFile(readinessIndicatorFile string) error { + // Quick first backoff up to ~1 second + backoff := utilwait.Backoff{ + Steps: 5, + Duration: 75 * time.Millisecond, + Factor: 2.0, + Jitter: 0.1, + } + if utilwait.ExponentialBackoff(backoff, func() (bool, error) { + _, err := os.Stat(readinessIndicatorFile) + return err == nil, nil + }) == nil { + return nil + } + + // Otherwise wait a longer time until the file exists pollDuration := 1000 * time.Millisecond pollTimeout := 45 * time.Second return utilwait.PollImmediate(pollDuration, pollTimeout, func() (bool, error) {