From 2439a12d34fc48df9ee865131c07461d551057cd 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, 2 insertions(+), 8 deletions(-) diff --git a/levant/deploy.go b/levant/deploy.go index 576a43f37..d1e68f106 100644 --- a/levant/deploy.go +++ b/levant/deploy.go @@ -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 @@ -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