node-status fix panic

This commit is contained in:
Alex Dadgar
2016-03-22 16:25:25 -07:00
parent a9e8857d04
commit 0872c8effd

View File

@@ -277,6 +277,9 @@ func getResources(client *api.Client, node *api.Node) ([]string, error) {
// Compute the total
r := node.Resources
res := node.Reserved
if res == nil {
res = &api.Resources{}
}
totalCpu = r.CPU - res.CPU
totalMem = r.MemoryMB - res.MemoryMB
totalDisk = r.DiskMB - res.DiskMB