Skip to content

Commit f608736

Browse files
committed
check if Memory is not nil for container stats
1 parent ea5be33 commit f608736

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/kubelet/stats/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func cadvisorInfoToCPUandMemoryStats(info *cadvisorapiv2.ContainerInfo) (*statsa
5151
cpuStats.UsageCoreNanoSeconds = &cstat.Cpu.Usage.Total
5252
}
5353
}
54-
if info.Spec.HasMemory {
54+
if info.Spec.HasMemory && cstat.Memory != nil {
5555
pageFaults := cstat.Memory.ContainerData.Pgfault
5656
majorPageFaults := cstat.Memory.ContainerData.Pgmajfault
5757
memoryStats = &statsapi.MemoryStats{

0 commit comments

Comments
 (0)