mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #98261 from wzshiming/fix-panic
kubelet: Fix NPE in ephemeral storage eviction
This commit is contained in:
commit
1a76d3ddfd
@ -509,7 +509,7 @@ func (m *managerImpl) podEphemeralStorageLimitEviction(podStats statsapi.PodStat
|
|||||||
|
|
||||||
// pod stats api summarizes ephemeral storage usage (container, emptyDir, host[etc-hosts, logs])
|
// pod stats api summarizes ephemeral storage usage (container, emptyDir, host[etc-hosts, logs])
|
||||||
podEphemeralStorageTotalUsage := &resource.Quantity{}
|
podEphemeralStorageTotalUsage := &resource.Quantity{}
|
||||||
if podStats.EphemeralStorage != nil {
|
if podStats.EphemeralStorage != nil && podStats.EphemeralStorage.UsedBytes != nil {
|
||||||
podEphemeralStorageTotalUsage = resource.NewQuantity(int64(*podStats.EphemeralStorage.UsedBytes), resource.BinarySI)
|
podEphemeralStorageTotalUsage = resource.NewQuantity(int64(*podStats.EphemeralStorage.UsedBytes), resource.BinarySI)
|
||||||
}
|
}
|
||||||
podEphemeralStorageLimit := podLimits[v1.ResourceEphemeralStorage]
|
podEphemeralStorageLimit := podLimits[v1.ResourceEphemeralStorage]
|
||||||
|
Loading…
Reference in New Issue
Block a user