mirror of https://github.com/k3s-io/k3s
check if Memory is not nil for container stats
parent
3a208b6893
commit
433c2f5f01
|
@ -51,7 +51,7 @@ func cadvisorInfoToCPUandMemoryStats(info *cadvisorapiv2.ContainerInfo) (*statsa
|
|||
cpuStats.UsageCoreNanoSeconds = &cstat.Cpu.Usage.Total
|
||||
}
|
||||
}
|
||||
if info.Spec.HasMemory {
|
||||
if info.Spec.HasMemory && cstat.Memory != nil {
|
||||
pageFaults := cstat.Memory.ContainerData.Pgfault
|
||||
majorPageFaults := cstat.Memory.ContainerData.Pgmajfault
|
||||
memoryStats = &statsapi.MemoryStats{
|
||||
|
|
Loading…
Reference in New Issue