mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #79057 from rphillips/fixes/e2e_kubelet_stats_fix
kubelet_stats: fix potential e2e crash dereferencing ContainerStats.CPU
This commit is contained in:
commit
1db31d474f
@ -599,6 +599,9 @@ func (r *resourceCollector) collectStats(oldStatsMap map[string]*kubeletstatsv1a
|
|||||||
}
|
}
|
||||||
|
|
||||||
if oldStats, ok := oldStatsMap[name]; ok {
|
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) {
|
if oldStats.CPU.Time.Equal(&cStats.CPU.Time) {
|
||||||
// No change -> skip this stat.
|
// No change -> skip this stat.
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user