Skip to content

Commit

Permalink
Add error handling when get error from some container
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksiiKhanin committed Feb 15, 2022
1 parent 6339d14 commit c67d87a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package core

import (
"context"
"github.com/sirupsen/logrus"
"sync"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
Expand Down Expand Up @@ -65,6 +66,8 @@ func (ds *dockerService) ListContainerStats(
mtx.Lock()
stats = append(stats, containerStats)
mtx.Unlock()
} else if err != nil {
logrus.Error(err, "Failed to get stats from container "+container.Id)
}
}()
}
Expand Down

0 comments on commit c67d87a

Please sign in to comment.