Skip to content

Commit e728821

Browse files
authored
fix(engine): do not force register on update binary (#6634)
* fix(engine): do not force register on update binary Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
1 parent 66ec567 commit e728821

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

engine/api/workermodel/registration.go

-26
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@ func ComputeRegistrationNeeds(db gorp.SqlExecutor, allBinaryReqs sdk.Requirement
2525

2626
for _, r := range reqs {
2727
switch r.Type {
28-
case sdk.BinaryRequirement:
29-
exist := false
30-
for _, e := range allBinaryReqs {
31-
if e.Value == r.Value {
32-
exist = true
33-
break
34-
}
35-
}
36-
if !exist {
37-
return updateAllToCheckRegistration(db)
38-
}
3928
case sdk.OSArchRequirement:
4029
nbOSArchReq++
4130
case sdk.ModelRequirement:
@@ -63,21 +52,6 @@ func ComputeRegistrationNeeds(db gorp.SqlExecutor, allBinaryReqs sdk.Requirement
6352
return nil
6453
}
6554

66-
// updateAllToCheckRegistration is like need_registration but without exclusive mode
67-
func updateAllToCheckRegistration(db gorp.SqlExecutor) error {
68-
query := `UPDATE worker_model SET check_registration = $1`
69-
res, err := db.Exec(query, true)
70-
if err != nil {
71-
return sdk.WithStack(err)
72-
}
73-
rows, err := res.RowsAffected()
74-
if err != nil {
75-
return sdk.WithStack(err)
76-
}
77-
log.Debug(context.Background(), "updateAllToCheckRegistration> %d worker model(s) check registration", rows)
78-
return nil
79-
}
80-
8155
// UpdateSpawnErrorWorkerModel updates worker model error registration
8256
func UpdateSpawnErrorWorkerModel(db gorp.SqlExecutor, modelID int64, spawnError sdk.SpawnErrorForm) error {
8357
spawnError.Error = sdk.RemoveNotPrintableChar(spawnError.Error)

0 commit comments

Comments
 (0)