Skip to content

Commit

Permalink
Merge pull request #104129 from adtac/cachemut-1.20
Browse files Browse the repository at this point in the history
job controller: don't mutate shared cache object
  • Loading branch information
k8s-ci-robot committed Sep 1, 2021
2 parents b9d77cc + ff055c1 commit c42cf17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/job/job_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ func (jm *Controller) syncJob(key string) (bool, error) {
}
return false, err
}
job := *sharedJob
// make a copy so we don't mutate the shared cache
job := *sharedJob.DeepCopy()

// if job was finished previously, we don't want to redo the termination
if IsJobFinished(&job) {
Expand Down

0 comments on commit c42cf17

Please sign in to comment.