Merge pull request #8749 from hashicorp/b-old-non-deployment

Handle migration of non-deployment jobs
This commit is contained in:
Mahmood Ali 2020-08-30 20:54:27 -04:00 committed by GitHub
commit cebd38f1c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -453,6 +453,13 @@ func (s *GenericScheduler) downgradedJobForPlacement(p placementResult) (string,
}
}
// check if the non-promoted version is a job without update stanza. This version should be the latest "stable" version,
// as all subsequent versions must be canaried deployments. Otherwise, we would have found a deployment above,
// or the alloc would have been replaced already by a newer non-deployment job.
if job, err := s.state.JobByIDAndVersion(nil, ns, jobID, p.MinJobVersion()); err == nil && job != nil && job.Update.IsEmpty() {
return "", job, err
}
return "", nil, nil
}