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 <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2021-09-09 17:00:27 +02:00
parent 53dc99fa60
commit 2b85382ca1
No known key found for this signature in database
GPG key ID: E4730F97F60286ED

View file

@ -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