From fbbc96da371148d2cd6ea005335e079a29af0b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Wed, 17 Nov 2021 10:55:11 +0100 Subject: [PATCH] Add guard close in event stream for not handling stopped Execution Environment Allocations --- internal/runner/manager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/runner/manager.go b/internal/runner/manager.go index 3b68878..ce18299 100644 --- a/internal/runner/manager.go +++ b/internal/runner/manager.go @@ -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")