Merge pull request #34998 from timstclair/sysdisk

Automatic merge from submit-queue

Don't report FS stats for system containers in the Kubelet Summary API

Fixes https://github.com/kubernetes/kubernetes/issues/31999
pull/6/head
Kubernetes Submit Queue 2016-10-20 00:07:56 -07:00 committed by GitHub
commit 333c045429
3 changed files with 9 additions and 6 deletions

View File

@ -146,7 +146,11 @@ func (sb *summaryBuilder) build() (*stats.Summary, error) {
}
for sys, name := range systemContainers {
if info, ok := sb.infos[name]; ok {
nodeStats.SystemContainers = append(nodeStats.SystemContainers, sb.containerInfoV2ToStats(sys, &info))
sysCont := sb.containerInfoV2ToStats(sys, &info)
// System containers don't have a filesystem associated with them.
sysCont.Rootfs = nil
sysCont.Logs = nil
nodeStats.SystemContainers = append(nodeStats.SystemContainers, sysCont)
}
}

View File

@ -183,8 +183,8 @@ func TestBuildSummary(t *testing.T) {
assert.EqualValues(t, testTime(creationTime, seed).Unix(), sys.StartTime.Time.Unix(), name+".StartTime")
checkCPUStats(t, name, seed, sys.CPU)
checkMemoryStats(t, name, seed, info, sys.Memory)
checkFsStats(t, rootfsCapacity, rootfsAvailable, totalRootfsInodes, rootfsInodesFree, sys.Logs)
checkFsStats(t, imagefsCapacity, imagefsAvailable, totalImagefsInodes, imagefsInodesFree, sys.Rootfs)
assert.Nil(t, sys.Logs, name+".Logs")
assert.Nil(t, sys.Rootfs, name+".Rootfs")
}
assert.Equal(t, 3, len(summary.Pods))

View File

@ -74,9 +74,8 @@ var _ = framework.KubeDescribe("Summary API", func() {
"PageFaults": bounded(1000, 1E9),
"MajorPageFaults": bounded(0, 100000),
}),
// TODO(#31999): Don't report FS stats for system containers.
"Rootfs": gstruct.Ignore(),
"Logs": gstruct.Ignore(),
"Rootfs": BeNil(),
"Logs": BeNil(),
"UserDefinedMetrics": BeEmpty(),
})
// Expectations for pods.