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 18, 2020
1 parent 05c6c36 commit dd0f7f0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions levant/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,7 @@ func (l *levantDeployment) deploy() (success bool) {

switch *l.config.Template.Job.Type {
case nomad.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
// deployment for end status.
depID, err := l.getDeploymentID(eval.EvalID)
Expand All @@ -173,6 +164,7 @@ 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 dd0f7f0

Please sign in to comment.