if ephemeral-storage not exist in initialCapacity, don't upgrade ephemeral-storage in node status

pull/564/head
changyaowei 2018-11-05 17:32:34 +08:00
parent f44a8a4cac
commit 3f422d9784
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
}
}
}