Skip to content

Commit

Permalink
Merge pull request #109473 from ii/fix-job-lifecycle-test
Browse files Browse the repository at this point in the history
Fix crash in E2E Job lifecycle test when the job doesn't have annotations
  • Loading branch information
k8s-ci-robot committed Apr 14, 2022
2 parents 10dcc6c + 931ad89 commit 8dfdbd4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/e2e/apps/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,9 @@ var _ = SIGDescribe("Job", func() {
patchedJob, err = jobClient.Get(context.TODO(), jobName, metav1.GetOptions{})
framework.ExpectNoError(err, "Unable to get job %s", jobName)
patchedJob.Spec.Suspend = pointer.BoolPtr(false)
if patchedJob.Annotations == nil {
patchedJob.Annotations = map[string]string{}
}
patchedJob.Annotations["updated"] = "true"
updatedJob, err = e2ejob.UpdateJob(f.ClientSet, ns, patchedJob)
return err
Expand Down

0 comments on commit 8dfdbd4

Please sign in to comment.