// ExpectStageStatus returns an AsyncAssertion for a StageStatus, given a ProgressiveSync object key and a stage name
ExpectStageStatus returns an AsyncAssertion for a StageStatus, given a ProgressiveSync object key and a stage name
// ExpectStageStatus returns an AsyncAssertion for a StageStatus given a ProgressiveSync object key and a stage name
func ExpectStageStatus(ctx context.Context, key client.ObjectKey, stageName string) AsyncAssertion {
	return Eventually(func() syncv1alpha1.StageStatus {
		ps := syncv1alpha1.ProgressiveSync{}
		err := k8sClient.Get(ctx, key, &ps)
		if err != nil {
			return syncv1alpha1.StageStatus{}
		}
		stageStatus := syncv1alpha1.FindStageStatus(ps.Status.Stages, stageName)
		if stageStatus != nil {
			return *stageStatus
		}
		return syncv1alpha1.StageStatus{}
	})
}
func ExpectStageStatus ( ctx context . Context , key client . ObjectKey , stageName string ) AsyncAssertion { return Eventually ( func ( ) syncv1alpha1 . StageStatus { ps := syncv1alpha1 . ProgressiveSync { } err := k8sClient . Get ( ctx , key , & ps ) if err != nil { return syncv1alpha1 . StageStatus { } } stageStatus := syncv1alpha1 . FindStageStatus ( ps . Status . Stages , stageName ) if stageStatus != nil { return * stageStatus } return syncv1alpha1 . StageStatus { } } ) }
ExpectStageStatus returns an AsyncAssertion for a StageStatus, given a ProgressiveSync object key and a stage name
ExpectStageStatus returns an AsyncAssertion for a StageStatus given a ProgressiveSync object key and a stage name