diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index f54d0bee5..794a5083a 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "strings" "time" "github.com/hashicorp/errwrap" @@ -745,6 +746,8 @@ func (j *Job) Validate() error { } if j.ID == "" { mErr.Errors = append(mErr.Errors, errors.New("Missing job ID")) + } else if strings.Contains(j.ID, " ") { + mErr.Errors = append(mErr.Errors, errors.New("Job ID contains a space")) } if j.Name == "" { mErr.Errors = append(mErr.Errors, errors.New("Missing job name"))