Skip to content

Commit

Permalink
Fix a bug in handling Nomad job types incorrectly.
Browse files Browse the repository at this point in the history
The case statement did not have a default clause when assesssing
the Nomad job type. This caused Levant to panic on some runs as
type is not an explicit type.

The change adds a default case to catch all job types which do not
support deployments.

Closes #31
  • Loading branch information
jrasell committed Nov 13, 2017
1 parent 6a9756a commit 53651f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion levant/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *nomadClient) Deploy(job *nomad.Job, autoPromote int) (success bool) {
case nomadStructs.JobTypeService:
logging.Debug("levant/deploy: beginning deployment watcher for job %s", *job.Name)
success = c.deploymentWatcher(eval.EvalID, autoPromote)
case nomadStructs.JobTypeBatch, nomadStructs.JobTypeSystem:
default:
logging.Debug("levant/deploy: job type %s does not support Nomad deployment model", *job.Type)
success = true
}
Expand Down

0 comments on commit 53651f9

Please sign in to comment.