8000 fix(hatchery,worker): remove temporary condition for model requiremen… · ovh/cds@5669676 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 5669676

Browse files
richardltsguiheux
authored andcommitted
fix(hatchery,worker): remove temporary condition for model requirement (#4452)
1 parent 594aad2 commit 5669676

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

engine/worker/requirement.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ func checkModelRequirement(w *currentWorker, r sdk.Requirement) (bool, error) {
123123
return modelName == fmt.Sprintf("%s/%s", w.model.Group.Name, w.model.Name), nil
124124
}
125125

126-
isSharedInfra := w.model.Group.Name == sdk.SharedInfraGroupName && modelName == w.model.Name
127-
isSameName := modelName == w.model.Name // for backward compatibility with runs, if only the name match we considered that the model can be used, keep this condition until the workflow runs were not migrated.
128-
return isSharedInfra || isSameName, nil
126+
return w.model.Group.Name == sdk.SharedInfraGroupName && modelName == w.model.Name, nil
129127
}
130128

131129
func checkNetworkAccessRequirement(w *currentWorker, r sdk.Requirement) (bool, error) {

sdk/hatchery/hatchery.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,7 @@ func canRunJob(h Interface, j workerStarterRequest, model sdk.Model) bool {
320320
modelName := strings.Split(r.Value, " ")[0]
321321
isGroupModel := modelName == fmt.Sprintf("%s/%s", model.Group.Name, model.Name)
322322
isSharedInfraModel := model.Group.Name == sdk.SharedInfraGroupName && modelName == model.Name
323-
isSameName := modelName == model.Name // for backward compatibility with runs, if only the name match we considered that the model can be used, keep this condition until the workflow runs were not migrated.
324-
if !isGroupModel && !isSharedInfraModel && !isSameName {
323+
if !isGroupModel && !isSharedInfraModel {
325324
log.Debug("canRunJob> %d - job %d - model requirement r.Value(%s) do not match model.Name(%s) and model.Group(%s)", j.timestamp, j.id, strings.Split(r.Value, " ")[0], model.Name, model.Group.Name)
326325
return false
327326
}

0 commit comments

Comments
 (0)
0