Skip to content

Commit

Permalink
Merge pull request #181 from ty-dc/e2e/fix-1
Browse files Browse the repository at this point in the history
fix: Added judgment on whether podList.Items is 0.
  • Loading branch information
weizhoublue authored Nov 22, 2023
2 parents 2eee770 + 7bc81fa commit bfaf254
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion framework/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (f *Framework) GetJobPodList(jb *batchv1.Job) (*corev1.PodList, error) {
return pods, nil
}

// WaitJobFinished wait for all job pod finish , no matter succceed or fail
// WaitJobFinished wait for all job pod finish , no matter succeed or fail
func (f *Framework) WaitJobFinished(jobName, namespace string, ctx context.Context) (*batchv1.Job, bool, error) {
for {
select {
Expand Down
2 changes: 1 addition & 1 deletion framework/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (f *Framework) GetPodListByLabel(label map[string]string) (*corev1.PodList,
}

func (f *Framework) CheckPodListRunning(podList *corev1.PodList) bool {
if podList == nil {
if podList == nil || len(podList.Items) == 0 {
return false
}
for _, item := range podList.Items {
Expand Down

0 comments on commit bfaf254

Please sign in to comment.