From 53651f9129853dc54494242d2e51b1e0cbb9c614 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Mon, 13 Nov 2017 16:03:29 +0000 Subject: [PATCH] Fix a bug in handling Nomad job types incorrectly. 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 --- levant/deploy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/levant/deploy.go b/levant/deploy.go index 01886a32a..f88aadda0 100644 --- a/levant/deploy.go +++ b/levant/deploy.go @@ -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 }