mirror of https://github.com/k3s-io/k3s
Merge pull request #77656 from yastij/check-cstat-mem
check if Memory is not nil for container statsk3s-v1.15.3
commit
ef9e794a36
|
@ -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