Skip to content

Commit 551417e

Browse files
committed
Check if container running
1 parent 61ec31f commit 551417e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/logstream/logstream.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,14 @@ func (m *LogStream) ConnectContainer(ctx context.Context, container LogProducing
229229
select {
230230
case logErr := <-container.GetLogProductionErrorChannel():
231231
if logErr != nil {
232+
// Check if the container is not stopped or terminated
233+
if !container.IsRunning() {
234+
m.log.Info().
235+
Str("Container name", name).
236+
Msg("Skipping log producer error as the container is not running anymore")
237+
break
238+
}
239+
232240
m.log.Error().
233241
Err(err).
234242
Str("Container name", name).

0 commit comments

Comments
 (0)