func executeCheck(method probeCallable, c container.ContainerInterface, probe *canaryv1.Probe) (bool, error) {
	time.Sleep(time.Duration(probe.InitialDelaySeconds) * time.Second)
	passes := 0
	fails := 0
	start := time.Now()
	for {
		passFail, err := method(c, probe)
		if err != nil {
			return false, err
		}
		if passFail {
			passes += 1
			fails = 0
		} else {
			fails += 1
			passes = 0
		}
		if passes >= probe.SuccessThreshold || fails >= probe.FailureThreshold {
			return passFail, err
		}
		if time.Since(start) > time.Duration(probe.TimeoutSeconds)*time.Second {
			return false, fmt.Errorf("check timed out after %d seconds", probe.TimeoutSeconds)
		}
		time.Sleep(time.Duration(probe.PeriodSeconds) * time.Second)
	}
}
// Run a check method with appropriate delay, retries and retry interval
Run a check method with appropriate delay, retries and retry interval
// Run a check method with appropriate delay retries and retry interval
func executeCheck(method probeCallable, c container.ContainerInterface, probe *canaryv1.Probe) (bool, error) {
	time.Sleep(time.Duration(probe.InitialDelaySeconds) * time.Second)
	passes := 0
	fails := 0
	start := time.Now()
	for {
		passFail, err := method(c, probe)
		if err != nil {
			return false, err
		}
		if passFail {
			passes += 1
			fails = 0
		} else {
			fails += 1
			passes = 0
		}
		if passes >= probe.SuccessThreshold || fails >= probe.FailureThreshold {
			return passFail, err
		}
		if time.Since(start) > time.Duration(probe.TimeoutSeconds)*time.Second {
			return false, fmt.Errorf("check timed out after %d seconds", probe.TimeoutSeconds)
		}
		time.Sleep(time.Duration(probe.PeriodSeconds) * time.Second)
	}
}
func executeCheck ( method probeCallable , c container . ContainerInterface , probe * canaryv1 . Probe ) ( bool , error ) { time . Sleep ( time . Duration ( probe . InitialDelaySeconds ) * time . Second ) passes := 0 fails := 0 start := time . Now ( ) for { passFail , err := method ( c , probe ) if err != nil { return false , err } if passFail { passes += 1 fails = 0 } else { fails += 1 passes = 0 } if passes >= probe . SuccessThreshold || fails >= probe . FailureThreshold { return passFail , err } if time . Since ( start ) > time . Duration ( probe . TimeoutSeconds ) * time . Second { return false , fmt . Errorf ( " " , probe . TimeoutSeconds ) } time . Sleep ( time . Duration ( probe . PeriodSeconds ) * time . Second ) } }
Run a check method with appropriate delay, retries and retry interval
Run a check method with appropriate delay retries and retry interval