mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Merge pull request #7051 from hashicorp/b-copy-jobs-oss
sentinel: copy jobs to prevent mutation
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user