Skip to content

Commit

Permalink
fix(api): don't split requirements model value (#4122)
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
  • Loading branch information
yesnault authored and fsamin committed Mar 28, 2019
1 parent 9a90678 commit e33e2c7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions engine/api/workflow/process_requirements.go
Expand Up @@ -42,7 +42,6 @@ func processNodeJobRunRequirements(db gorp.SqlExecutor, j sdk.Job, run *sdk.Work
errm.Append(sdk.ErrInvalidJobRequirementDuplicateModel)
break
}
value = strings.Split(value, " ")[0]
model = value
}

Expand All @@ -52,7 +51,7 @@ func processNodeJobRunRequirements(db gorp.SqlExecutor, j sdk.Job, run *sdk.Work
var modelType string
if model != "" {
// Load the worker model
wm, err := worker.LoadWorkerModelByName(db, model)
wm, err := worker.LoadWorkerModelByName(db, strings.Split(model, " ")[0])
if err != nil {
log.Error("getNodeJobRunRequirements> error while getting worker model %s: %v", model, err)
errm.Append(sdk.ErrNoWorkerModel)
Expand Down

0 comments on commit e33e2c7

Please sign in to comment.