8000 feat(hatchery): clean group info in model name (#4242) · ovh/cds@4a61581 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 4a61581

Browse files
richardltsguiheux
authored andcommitted
feat(hatchery): clean group info in model name (#4242)
1 parent 3668678 commit 4a61581

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

sdk/hatchery/hatchery.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,16 @@ func canRunJob(h Interface, j workerStarterRequest, model sdk.Model) bool {
356356
// If requirement is a Model requirement, it's easy. It's either can or can't run
357357
// r.Value could be: theModelName --port=8888:9999, so we take strings.Split(r.Value, " ")[0] to compare
358358
// only modelName
359-
if r.Type == sdk.ModelRe 91DE quirement && strings.Split(r.Value, " ")[0] != model.Name {
360-
log.Debug("canRunJob> %d - job %d - model requirement r.Value(%s) != model.Name(%s)", j.timestamp, j.id, strings.Split(r.Value, " ")[0], model.Name)
361-
return false
359+
if r.Type == sdk.ModelRequirement {
360+
modelName := strings.Split(r.Value, " ")[0]
361+
modelPath := strings.SplitN(modelName, "/", 2)
362+
if len(modelPath) == 2 {
363+
modelName = modelPath[1]
364+
}
365+
if modelName != model.Name {
366+
log.Debug("canRunJob> %d - job %d - model requirement r.Value(%s) != model.Name(%s)", j.timestamp, j.id, strings.Split(r.Value, " ")[0], model.Name)
367+
return false
368+
}
362369
}
363370

364371
// If requirement is an hostname requirement, it's for a specific worker

0 commit comments

Comments
 (0)
0