Skip to content

Commit

Permalink
Merge pull request #246 from jrasell/gh_243
Browse files Browse the repository at this point in the history
Fix bug where job deploys with count 0 hang.
  • Loading branch information
jrasell authored Oct 24, 2018
2 parents 3403620 + ce81103 commit eef809e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions levant/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ func (l *levantDeployment) deploy() (success bool) {
}
}

if l.isJobZeroCount() {
return true
}

switch *l.config.Template.Job.Type {
case nomadStructs.JobTypeService:

Expand Down Expand Up @@ -485,3 +489,12 @@ func (l *levantDeployment) dynamicGroupCountUpdater() error {
}
return nil
}

func (l *levantDeployment) isJobZeroCount() bool {
for _, tg := range l.config.Template.Job.TaskGroups {
if *tg.Count > 0 {
return false
}
}
return true
}

0 comments on commit eef809e

Please sign in to comment.