Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db770db

Browse files
richardltbnjjj
authored andcommitted
feat(api): ignore worker model group name in requirement (#4257)
1 parent 466bfe0 commit db770db

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

engine/api/workflow/process_requirements.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ func processNodeJobRunRequirements(db gorp.SqlExecutor, j sdk.Job, run *sdk.Work
5454

5555
var modelType string
5656
if model != "" {
57-
// Load the worker model
58-
wm, err := worker.LoadWorkerModelByName(db, strings.Split(model, " ")[0])
57+
// load the worker model, if there is group name in the model name, ignore it.
58+
modelName := strings.Split(model, " ")[0]
59+
modelPath := strings.SplitN(modelName, "/", 2)
60+
if len(modelPath) == 2 {
61+
modelName = modelPath[1]
62+
}
63+
wm, err := worker.LoadWorkerModelByName(db, modelName)
5964
if err != nil {
6065
log.Error("getNodeJobRunRequirements> error while getting worker model %s: %v", model, err)
6166
errm.Append(sdk.ErrNoWorkerModel)

0 commit comments

Comments
 (0)