Use IsParameterized/isPeriodic methods

This commit is contained in:
Preetha Appan 2019-01-17 12:15:42 -06:00
parent 81a8f18cac
commit be36fee48e
No known key found for this signature in database
GPG key ID: 9F7C19990A50EAFC
2 changed files with 2 additions and 3 deletions

View file

@ -1403,7 +1403,7 @@ func (n *nomadFSM) reconcileQueuedAllocations(index uint64) error {
job := rawJob.(*structs.Job)
// Nothing to do for queued allocations if the job is a parent periodic/parameterized job
if job.ParentID == "" && (job.Periodic != nil || job.ParameterizedJob != nil) {
if job.IsParameterized() || job.IsPeriodic() {
continue
}
planner := &scheduler.Harness{

View file

@ -3057,8 +3057,7 @@ func (s *StateStore) ReconcileJobSummaries(index uint64) error {
}
job := rawJob.(*structs.Job)
if (job.ParameterizedJob != nil || job.Periodic != nil) && job.ParentID == "" {
if job.IsParameterized() || job.IsPeriodic() {
// COMPAT: Remove after 0.11
// The following block of code fixes incorrect child summaries due to a bug