mirror of https://github.com/k3s-io/k3s
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/31999pull/6/head
commit
333c045429
|
@ -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