Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/e2e/backup_restore_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var _ = Describe("AWS backup restore tests", func() {
Expect(err).NotTo(HaveOccurred())

log.Printf("Waiting for velero pod to be running")
Eventually(isVeleroPodRunning(namespace), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
Eventually(areVeleroPodsRunning(namespace), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())

if brCase.BackupRestoreType == restic {
log.Printf("Waiting for restic pods to be running")
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/subscription_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var _ = Describe("Subscription Config Suite Test", func() {
velero, err := vel.Get()
Expect(err).NotTo(HaveOccurred())
log.Printf("Waiting for velero pod to be running")
Eventually(isVeleroPodRunning(namespace), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
Eventually(areVeleroPodsRunning(namespace), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
if velero.Spec.Configuration.Restic.Enable != nil && *velero.Spec.Configuration.Restic.Enable {
log.Printf("Waiting for restic pods to be running")
Eventually(areResticPodsRunning(namespace), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/velero_deployment_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var _ = Describe("Configuration testing for DPA Custom Resource", func() {
return
}
log.Printf("Waiting for velero pod to be running")
Eventually(isVeleroPodRunning(namespace), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
Eventually(areVeleroPodsRunning(namespace), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
dpa, err := vel.Get()
Expect(err).NotTo(HaveOccurred())
if len(dpa.Spec.BackupLocations) > 0 {
Expand Down
14 changes: 6 additions & 8 deletions tests/e2e/velero_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,19 @@ func getVeleroPods(namespace string) (*corev1.PodList, error) {
return podList, nil
}

func isVeleroPodRunning(namespace string) wait.ConditionFunc {
func areVeleroPodsRunning(namespace string) wait.ConditionFunc {
return func() (bool, error) {
podList, err := getVeleroPods(namespace)
if err != nil {
return false, err
}
// get pod name and status with specified label selector
var status string
for _, podInfo := range (*podList).Items {
status = string(podInfo.Status.Phase)
}
if status == "Running" {
return true, nil
if podInfo.Status.Phase != corev1.PodRunning {
log.Printf("pod: %s is not yet running with status: %v", podInfo.Name, podInfo.Status)
return false, nil
}
}
return false, err
return true, nil
}
}

Expand Down