From 6ee6708379afa47f1244304bf4b0dcadfcefcf5e Mon Sep 17 00:00:00 2001 From: Vincent van Dam Date: Mon, 19 Jul 2021 18:51:35 +0200 Subject: [PATCH] Fix panic closing logs channel --- internal/backend/logs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/backend/logs.go b/internal/backend/logs.go index 7ff33c8..b99d5e2 100644 --- a/internal/backend/logs.go +++ b/internal/backend/logs.go @@ -33,7 +33,6 @@ func (in *instance) GetLogs(tainr *types.Container, follow bool, count int, stop defer stream.Close() stopL := make(chan struct{}, 1) - defer close(stopL) if follow { go func() { @@ -51,6 +50,7 @@ func (in *instance) GetLogs(tainr *types.Container, follow bool, count int, stop // close when container is done select { case <-stopL: + close(stopL) return nil default: }