Make data mover fail early

Signed-off-by: Ming <mqiu@vmware.com>
This commit is contained in:
Ming
2023-11-29 03:03:53 +00:00
committed by Ming Qiu
parent 6ac7ff1230
commit 03dff100a3
8 changed files with 170 additions and 40 deletions
@@ -632,7 +632,7 @@ func TestFindDataDownloadForPod(t *testing.T) {
{
name: "find dataDownload for pod",
du: dataDownloadBuilder().Phase(velerov2alpha1api.DataDownloadPhaseAccepted).Result(),
pod: builder.ForPod(velerov1api.DefaultNamespace, dataDownloadName).Labels(map[string]string{velerov1api.DataDownloadLabel: dataDownloadName}).Result(),
pod: builder.ForPod(velerov1api.DefaultNamespace, dataDownloadName).Labels(map[string]string{velerov1api.DataDownloadLabel: dataDownloadName}).Status(corev1.PodStatus{Phase: corev1.PodRunning}).Result(),
checkFunc: func(du *velerov2alpha1api.DataDownload, requests []reconcile.Request) {
// Assert that the function returns a single request
assert.Len(t, requests, 1)