mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Fix race in scheduledjob e2e
This commit is contained in:
parent
5dac1122b4
commit
9481354d77
@ -275,8 +275,11 @@ func waitForJobReplaced(c *client.Client, ns, previousJobName string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
if len(jobs.Items) != 1 {
|
if len(jobs.Items) > 1 {
|
||||||
return false, fmt.Errorf("More than one job is running")
|
return false, fmt.Errorf("More than one job is running %+v", jobs.Items)
|
||||||
|
} else if len(jobs.Items) == 0 {
|
||||||
|
framework.Logf("Warning: Found 0 jobs in namespace %v", ns)
|
||||||
|
return false, nil
|
||||||
}
|
}
|
||||||
return jobs.Items[0].Name != previousJobName, nil
|
return jobs.Items[0].Name != previousJobName, nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user