Merge pull request #70645 from changyaowei/node_ephemeral-storage

Fix bug: when kubelet restart, the ephemeral-storage in node status upgrade to 0
pull/564/head
k8s-ci-robot 2018-11-29 21:44:53 -08:00 committed by GitHub
commit af6bf1e436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -270,7 +270,9 @@ func MachineInfo(nodeName string,
// capacity for every node status request
initialCapacity := capacityFunc()
if initialCapacity != nil {
node.Status.Capacity[v1.ResourceEphemeralStorage] = initialCapacity[v1.ResourceEphemeralStorage]
if v, exists := initialCapacity[v1.ResourceEphemeralStorage]; exists {
node.Status.Capacity[v1.ResourceEphemeralStorage] = v
}
}
}