Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 2439a12

Browse files
committed
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.
1 parent dee2715 commit 2439a12

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

levant/deploy.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,6 @@ func (l *levantDeployment) deploy() (success bool) {
152152

153153
switch *l.config.Template.Job.Type {
154154
case nomadStructs.JobTypeService:
155-
156-
// If the service job doesn't have an update stanza, the job will not use
157-
// Nomad deployments.
158-
if l.config.Template.Job.Update == nil {
159-
log.Info().Msg("levant/deploy: job is not configured with update stanza, consider adding to use deployments")
160-
return l.jobStatusChecker(&eval.EvalID)
161-
}
162-
163155
log.Info().Msgf("levant/deploy: beginning deployment watcher for job")
164156

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

165+
log.Info().Msgf("levant/deploy: watching deployment %s for job", depID)
166+
173167
// Get the success of the deployment and return if we have success.
174168
if success = l.deploymentWatcher(depID); success {
175169
return

0 commit comments

Comments
 (0)