Retry job update after failure to prevent modification conflict

This commit is contained in:
Maciej Szulik
2016-11-18 11:47:02 +01:00
parent 3b43ce8e5c
commit b253c20d80
4 changed files with 32 additions and 4 deletions

View File

@@ -193,8 +193,9 @@ var _ = framework.KubeDescribe("Job", func() {
// the job stabilized and won't be synced until modification or full
// resync happens, we don't want to wait for the latter so we force
// sync modifying it
job.Spec.Parallelism = &completions
job, err = updateJob(f.ClientSet, f.Namespace.Name, job)
_, err = framework.UpdateJobWithRetries(f.ClientSet, f.Namespace.Name, job.Name, func(update *batch.Job) {
update.Spec.Parallelism = &completions
})
Expect(err).NotTo(HaveOccurred())
err = waitForJobFail(f.ClientSet, f.Namespace.Name, job.Name, jobTimeout)
}