2021-10-01 13:59:55 +00:00
|
|
|
//go:build !ent
|
2017-09-19 14:47:10 +00:00
|
|
|
// +build !ent
|
|
|
|
|
|
|
|
package nomad
|
|
|
|
|
2020-07-17 14:41:45 +00:00
|
|
|
import (
|
|
|
|
"github.com/hashicorp/nomad/nomad/structs"
|
|
|
|
)
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
// enforceSubmitJob is used to check any Sentinel policies for the submit-job scope
|
2022-08-18 20:33:00 +00:00
|
|
|
func (j *Job) enforceSubmitJob(override bool, job *structs.Job, nomadACLToken *structs.ACLToken, ns *structs.Namespace) (error, error) {
|
2017-09-19 14:47:10 +00:00
|
|
|
return nil, nil
|
|
|
|
}
|
2020-06-15 20:18:14 +00:00
|
|
|
|
2022-11-25 17:45:34 +00:00
|
|
|
// multiregionCreateDeployment is used to create a deployment to register along
|
|
|
|
// with the job, if required.
|
|
|
|
func (j *Job) multiregionCreateDeployment(job *structs.Job, eval *structs.Evaluation) *structs.Deployment {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-06-15 20:18:14 +00:00
|
|
|
// multiregionRegister is used to send a job across multiple regions
|
2020-10-12 17:59:48 +00:00
|
|
|
func (j *Job) multiregionRegister(args *structs.JobRegisterRequest, reply *structs.JobRegisterResponse, newVersion uint64) (bool, error) {
|
2020-07-14 14:57:37 +00:00
|
|
|
return false, nil
|
|
|
|
}
|
2020-07-03 14:44:41 +00:00
|
|
|
|
2020-07-14 14:57:37 +00:00
|
|
|
// multiregionStart is used to kick-off a deployment across multiple regions
|
|
|
|
func (j *Job) multiregionStart(args *structs.JobRegisterRequest, reply *structs.JobRegisterResponse) error {
|
2020-06-15 20:18:14 +00:00
|
|
|
return nil
|
|
|
|
}
|
2020-06-24 17:24:55 +00:00
|
|
|
|
2020-08-27 18:54:45 +00:00
|
|
|
// multiregionDrop is used to deregister regions from a previous version of the
|
|
|
|
// job that are no longer in use
|
|
|
|
func (j *Job) multiregionDrop(args *structs.JobRegisterRequest, reply *structs.JobRegisterResponse) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-08-28 18:28:13 +00:00
|
|
|
// multiregionStop is used to fan-out Job.Deregister RPCs to all regions if
|
|
|
|
// the global flag is passed to Job.Deregister
|
|
|
|
func (j *Job) multiregionStop(job *structs.Job, args *structs.JobDeregisterRequest, reply *structs.JobDeregisterResponse) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-06-24 17:24:55 +00:00
|
|
|
// interpolateMultiregionFields interpolates a job for a specific region
|
|
|
|
func (j *Job) interpolateMultiregionFields(args *structs.JobPlanRequest) error {
|
|
|
|
return nil
|
|
|
|
}
|
2022-09-12 13:24:26 +00:00
|
|
|
|
|
|
|
// multiregionSpecChanged checks to see if the job spec has changed. If the job is multiregion,
|
|
|
|
// it checks all regions to determine if any deployed jobs instances have been stopped or
|
|
|
|
// otherwise differ from the incoming jobspec. Since multiregion jobs require coordinated
|
|
|
|
// deployments and synchronized job versions across all regions, a change in one requires
|
|
|
|
// redeployment of all.
|
|
|
|
func (j *Job) multiregionSpecChanged(existingJob *structs.Job, args *structs.JobRegisterRequest) (bool, error) {
|
|
|
|
return existingJob.SpecChanged(args.Job), nil
|
|
|
|
}
|