mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Don't report FS stats for system containers
This commit is contained in:
parent
4a13431af3
commit
bd80da5822
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user