mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
start all but first region deployment in paused state
This commit is contained in:
@@ -3772,7 +3772,7 @@ func (j *Job) Validate() error {
|
||||
if j.Priority < JobMinPriority || j.Priority > JobMaxPriority {
|
||||
mErr.Errors = append(mErr.Errors, fmt.Errorf("Job priority must be between [%d, %d]", JobMinPriority, JobMaxPriority))
|
||||
}
|
||||
if len(j.Datacenters) == 0 {
|
||||
if len(j.Datacenters) == 0 && !j.IsMultiregion() {
|
||||
mErr.Errors = append(mErr.Errors, errors.New("Missing job datacenters"))
|
||||
} else {
|
||||
for _, v := range j.Datacenters {
|
||||
|
||||
@@ -546,6 +546,11 @@ func (a *allocReconciler) computeGroup(group string, all allocSet) bool {
|
||||
// A previous group may have made the deployment already
|
||||
if a.deployment == nil {
|
||||
a.deployment = structs.NewDeployment(a.job)
|
||||
// only the first region of a multiregion job starts in the
|
||||
// running state
|
||||
if a.job.IsMultiregion() && a.job.Region != a.job.Multiregion.Regions[0].Name {
|
||||
a.deployment.Status = structs.DeploymentStatusPaused
|
||||
}
|
||||
a.result.deployment = a.deployment
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user