// waitForPodSuccessOrFail waits for v1.PodSucceeded or fail.
waitForPodSuccessOrFail waits for v1.PodSucceeded or fail.
// waitForPodSuccessOrFail waits for v1 . PodSucceeded or fail .
func waitForPodSuccessOrFail(ctx context.Context, client *eventingtestlib.Client, pod *corev1.Pod) {
	err := test.WaitForPodState(ctx, client.Kube, func(p *corev1.Pod) (bool, error) {
		if p.Status.Phase == corev1.PodFailed {
			log, e := test.PodLogs(ctx, client.Kube, p.Name, p.Spec.Containers[0].Name, p.Namespace)
			return true, fmt.Errorf("pod %s failed. (log, err)=: (\n%v,\n%v)", p.Name, string(log), e)
		} else if p.Status.Phase != corev1.PodSucceeded {
			return false, nil
		}
		return true, nil
	}, pod.Name, pod.Namespace)
	if err != nil {
		client.T.Fatalf("Failed waiting for completeness of the pod: %v", err)
	}
}
func waitForPodSuccessOrFail ( ctx context . Context , client * eventingtestlib . Client , pod * corev1 . Pod ) { err := test . WaitForPodState ( ctx , client . Kube , func ( p * corev1 . Pod ) ( bool , error ) { if p . Status . Phase == corev1 . PodFailed { log , e := test . PodLogs ( ctx , client . Kube , p . Name , p . Spec . Containers [ 0 ] . Name , p . Namespace ) return true , fmt . Errorf ( " \n \n " , p . Name , string ( log ) , e ) } else if p . Status . Phase != corev1 . PodSucceeded { return false , nil } return true , nil } , pod . Name , pod . Namespace ) if err != nil { client . T . Fatalf ( " " , err ) } }
waitForPodSuccessOrFail waits for v1.PodSucceeded or fail.
waitForPodSuccessOrFail waits for v1 . PodSucceeded or fail .