Skip to content

Commit

Permalink
feat(api): ignore worker model group name in requirement (#4257)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt authored and bnjjj committed May 6, 2019
1 parent 466bfe0 commit db770db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions engine/api/workflow/process_requirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ 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, strings.Split(model, " ")[0])
// load the worker model, if there is group name in the model name, ignore it.
modelName := strings.Split(model, " ")[0]
modelPath := strings.SplitN(modelName, "/", 2)
if len(modelPath) == 2 {
modelName = modelPath[1]
}
wm, err := worker.LoadWorkerModelByName(db, modelName)
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 db770db

Please sign in to comment.