Add guard close in event stream

for not handling stopped Execution Environment Allocations
This commit is contained in:
Maximilian Paß
2021-11-17 10:55:11 +01:00
parent aa87556a45
commit fbbc96da37

View File

@ -261,6 +261,10 @@ func (m *NomadRunnerManager) onAllocationAdded(alloc *nomadApi.Allocation) {
func (m *NomadRunnerManager) onAllocationStopped(alloc *nomadApi.Allocation) {
log.WithField("id", alloc.JobID).Debug("Runner stopped")
if nomad.IsEnvironmentTemplateID(alloc.JobID) {
return
}
environmentID, err := nomad.EnvironmentIDFromRunnerID(alloc.JobID)
if err != nil {
log.WithError(err).Warn("Stopped allocation can not be handled")