Skip to content

Commit

Permalink
Use deployment watcher if there's a deploy ID
Browse files Browse the repository at this point in the history
Previously levant would check the template contained an update stanza at
the job level, before watching for a service job deployment to complete.

With this change, we'll always wait for a deployment to complete. This
allows the Nomad server to be the one to determine if the template has a
"deployment" rather than levant.
  • Loading branch information
Mongey committed Dec 2, 2019
1 parent dee2715 commit 2439a12
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions levant/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,6 @@ func (l *levantDeployment) deploy() (success bool) {

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

// If the service job doesn't have an update stanza, the job will not use
// Nomad deployments.
if l.config.Template.Job.Update == nil {
log.Info().Msg("levant/deploy: job is not configured with update stanza, consider adding to use deployments")
return l.jobStatusChecker(&eval.EvalID)
}

log.Info().Msgf("levant/deploy: beginning deployment watcher for job")

// Get the deploymentID from the evaluationID so that we can watch the
Expand All @@ -170,6 +162,8 @@ func (l *levantDeployment) deploy() (success bool) {
return
}

log.Info().Msgf("levant/deploy: watching deployment %s for job", depID)

// Get the success of the deployment and return if we have success.
if success = l.deploymentWatcher(depID); success {
return
Expand Down

0 comments on commit 2439a12

Please sign in to comment.