Merge pull request #98261 from wzshiming/fix-panic

kubelet: Fix NPE in ephemeral storage eviction
This commit is contained in:
Kubernetes Prow Robot 2021-01-28 17:00:32 -08:00 committed by GitHub
commit 1a76d3ddfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -509,7 +509,7 @@ func (m *managerImpl) podEphemeralStorageLimitEviction(podStats statsapi.PodStat
// pod stats api summarizes ephemeral storage usage (container, emptyDir, host[etc-hosts, logs])
podEphemeralStorageTotalUsage := &resource.Quantity{}
if podStats.EphemeralStorage != nil {
if podStats.EphemeralStorage != nil && podStats.EphemeralStorage.UsedBytes != nil {
podEphemeralStorageTotalUsage = resource.NewQuantity(int64(*podStats.EphemeralStorage.UsedBytes), resource.BinarySI)
}
podEphemeralStorageLimit := podLimits[v1.ResourceEphemeralStorage]