Merge pull request #9520 from hashicorp/b-fix-nullchar-error-msg

core: fix typo msg used when job ID/name contains a null char.
This commit is contained in:
James Rasell 2020-12-04 17:40:08 +01:00 committed by GitHub
commit 3934d3daca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4046,12 +4046,12 @@ func (j *Job) Validate() error {
} else if strings.Contains(j.ID, " ") {
mErr.Errors = append(mErr.Errors, errors.New("Job ID contains a space"))
} else if strings.Contains(j.ID, "\000") {
mErr.Errors = append(mErr.Errors, errors.New("Job ID contains a null chararacter"))
mErr.Errors = append(mErr.Errors, errors.New("Job ID contains a null character"))
}
if j.Name == "" {
mErr.Errors = append(mErr.Errors, errors.New("Missing job name"))
} else if strings.Contains(j.Name, "\000") {
mErr.Errors = append(mErr.Errors, errors.New("Job Name contains a null chararacter"))
mErr.Errors = append(mErr.Errors, errors.New("Job Name contains a null character"))
}
if j.Namespace == "" {
mErr.Errors = append(mErr.Errors, errors.New("Job must be in a namespace"))