Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify job.Type isn't nil before continuing #34

Merged
merged 4 commits into from
Nov 15, 2017

Conversation

ygersie
Copy link
Contributor

@ygersie ygersie commented Nov 14, 2017

The switch will still lead to a SEGV as the dereference is to a nil
pointer. First verify that job.Type isn't nil.

Still the same issue as here: #31

  The switch will still lead to a SEGV as the dereference is to a nil
  pointer. First verify that job.Type isn't nil.
levant/deploy.go Outdated
@@ -47,6 +47,12 @@ func (c *nomadClient) Deploy(job *nomad.Job, autoPromote int) (success bool) {
return
}

// If job.Type isn't set we can't continue
if job.Type == nil {
logging.Error("levant/deploy: Nomad job `type` is not set. Should be set to `service`")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pedantic I know; but could the log messaged be change slightly? In particular not set. Should to not set, should

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, change is pushed!

@jrasell
Copy link
Member

jrasell commented Nov 14, 2017

Thanks for the PR @dropje86, I added a small comment about the log line but other than that it looks good.

@jrasell jrasell merged commit 3e13cd0 into hashicorp:master Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants