Merge pull request #51575 from derekwaynecarr/fix-stats

Automatic merge from submit-queue (batch tested with PRs 51590, 48217, 51209, 51575, 48627)

Skip system container cgroup stats if undefined

**What this PR does / why we need it**:
the kubelet /stats/summary endpoint tried to look up cgroup stats for containers that are not required.  this polluted logs with messages about not finding stats for "" container.  this pr skips cgroup stats if the cgroup name is not specified (they are optional anyway)

**Special notes for your reviewer**:
i think this was a regression from recent refactor.

**Release note**:
```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-09-02 11:12:13 -07:00 committed by GitHub
commit ddef5f1ef9

View File

@ -83,6 +83,10 @@ func (sp *summaryProviderImpl) Get() (*statsapi.Summary, error) {
statsapi.SystemContainerMisc: nodeConfig.SystemCgroupsName,
}
for sys, name := range systemContainers {
// skip if cgroup name is undefined (not all system containers are required)
if name == "" {
continue
}
s, _, err := sp.provider.GetCgroupStats(name)
if err != nil {
glog.Errorf("Failed to get system container stats for %q: %v", name, err)