Fix multiple user Runner use

A before unknown Nomad reload adds already known runner again to the idle runner - even if they are already in use.
This commit is contained in:
Maximilian Paß
2023-03-15 09:16:52 +00:00
committed by Sebastian Serth
parent 0d829c9308
commit e0db1bafe8
3 changed files with 18 additions and 3 deletions

View File

@ -146,6 +146,11 @@ func (m *NomadRunnerManager) onAllocationAdded(alloc *nomadApi.Allocation, start
return
}
if _, ok := m.usedRunners.Get(alloc.JobID); ok {
log.WithField("id", alloc.JobID).Debug("Started Runner is already in use")
return
}
environmentID, err := nomad.EnvironmentIDFromRunnerID(alloc.JobID)
if err != nil {
log.WithError(err).Warn("Allocation could not be added")