From dd0f7f0abb9a55dfff4e474d817c1ab686487b63 Mon Sep 17 00:00:00 2001 From: Conor Mongey Date: Mon, 2 Dec 2019 14:43:19 +0000 Subject: [PATCH] Use deployment watcher if there's a deploy ID 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. --- levant/deploy.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/levant/deploy.go b/levant/deploy.go index 01b0c33eb..a0c983c6d 100644 --- a/levant/deploy.go +++ b/levant/deploy.go @@ -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) @@ -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