Skip to content

Commit

Permalink
Merge pull request #77731 from yastij/automated-cherry-pick-of-#77656…
Browse files Browse the repository at this point in the history
…-upstream-release-1.12

Automated cherry pick of #77656: check if Memory is not nil for container stats
  • Loading branch information
k8s-ci-robot committed May 14, 2019
2 parents 1c74d93 + 6733165 commit 8c3d596
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kubelet/stats/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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{
Expand Down

0 comments on commit 8c3d596

Please sign in to comment.