mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
kubelet_stats: fix potential e2e crash dereferencing CPU
This commit is contained in:
@@ -598,6 +598,9 @@ func (r *resourceCollector) collectStats(oldStatsMap map[string]*stats.Container
|
||||
}
|
||||
|
||||
if oldStats, ok := oldStatsMap[name]; ok {
|
||||
if oldStats.CPU == nil || cStats.CPU == nil || oldStats.Memory == nil || cStats.Memory == nil {
|
||||
continue
|
||||
}
|
||||
if oldStats.CPU.Time.Equal(&cStats.CPU.Time) {
|
||||
// No change -> skip this stat.
|
||||
continue
|
||||
|
Reference in New Issue
Block a user