From 2b85382ca187fdcc000803b1d26d8b46e8cb755f Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 9 Sep 2021 17:00:27 +0200 Subject: api: correctly set the container stats override the outer scope variable instead of creating a local one. Otherwise the wrong variable would be used for the next iterations. Signed-off-by: Giuseppe Scrivano --- pkg/api/handlers/compat/containers_stats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/api/handlers/compat/containers_stats.go') diff --git a/pkg/api/handlers/compat/containers_stats.go b/pkg/api/handlers/compat/containers_stats.go index 851955207..b95fbfdd8 100644 --- a/pkg/api/handlers/compat/containers_stats.go +++ b/pkg/api/handlers/compat/containers_stats.go @@ -97,7 +97,7 @@ streamLabel: // A label to flatten the scope default: // Container stats - stats, err := ctnr.GetContainerStats(stats) + stats, err = ctnr.GetContainerStats(stats) if err != nil { logrus.Errorf("Unable to get container stats: %v", err) return -- cgit v1.2.3-54-g00ecf