Skip to content

Commit

Permalink
Fix parameterized <-> non-parameterized job error (#10357)
Browse files Browse the repository at this point in the history
The error messages are reversed from tests performed above them.  The test uses the `validateJobUpdate()` function, but ignores the text of the error message itself.
  • Loading branch information
angrycub authored Apr 12, 2021
1 parent 1b453fb commit 02a8e6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nomad/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -1830,10 +1830,10 @@ func validateJobUpdate(old, new *structs.Job) error {

// Transitioning to/from parameterized is disallowed
if old.IsParameterized() && !new.IsParameterized() {
return fmt.Errorf("cannot update non-parameterized job to being parameterized")
return fmt.Errorf("cannot update parameterized job to being non-parameterized")
}
if new.IsParameterized() && !old.IsParameterized() {
return fmt.Errorf("cannot update parameterized job to being non-parameterized")
return fmt.Errorf("cannot update non-parameterized job to being parameterized")
}

if old.Dispatched != new.Dispatched {
Expand Down

0 comments on commit 02a8e6c

Please sign in to comment.