Skip to content

Commit

Permalink
Merge pull request #7051 from hashicorp/b-copy-jobs-oss
Browse files Browse the repository at this point in the history
sentinel: copy jobs to prevent mutation
  • Loading branch information
Mahmood Ali authored Feb 3, 2020
2 parents ce3d581 + 5dbccce commit 445d019
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nomad/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ func (j *Job) Register(args *structs.JobRegisterRequest, reply *structs.JobRegis
}
}

// Enforce Sentinel policies
policyWarnings, err := j.enforceSubmitJob(args.PolicyOverride, args.Job)
// Enforce Sentinel policies. Pass a copy of the job to prevent
// sentinel from altering it.
policyWarnings, err := j.enforceSubmitJob(args.PolicyOverride, args.Job.Copy())
if err != nil {
return err
}
Expand Down

0 comments on commit 445d019

Please sign in to comment.