job controller: don't mutate shared cache object

Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
This commit is contained in:
Adhityaa Chandrasekar 2021-03-25 06:31:35 +00:00
parent 4118dff509
commit 0a21157c96

View File

@ -462,7 +462,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) {