Commit ddef5f1e authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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 ```
parents 139e5274 ef9b398f
...@@ -83,6 +83,10 @@ func (sp *summaryProviderImpl) Get() (*statsapi.Summary, error) { ...@@ -83,6 +83,10 @@ func (sp *summaryProviderImpl) Get() (*statsapi.Summary, error) {
statsapi.SystemContainerMisc: nodeConfig.SystemCgroupsName, statsapi.SystemContainerMisc: nodeConfig.SystemCgroupsName,
} }
for sys, name := range systemContainers { 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) s, _, err := sp.provider.GetCgroupStats(name)
if err != nil { if err != nil {
glog.Errorf("Failed to get system container stats for %q: %v", name, err) glog.Errorf("Failed to get system container stats for %q: %v", name, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment