Add error check to heapsterclient response

Add labelSelector to pod metrics api
Remove pod metrics in resources API
This commit is contained in:
jeff
2018-06-26 14:42:36 +08:00
parent 471c5d7b48
commit 8a04650e29
8 changed files with 80 additions and 58 deletions

View File

@@ -54,6 +54,12 @@ func GetHeapsterMetricsJson(url string) *jason.Object {
}
}
// return empty json in case of error response from es-node
if data == nil {
emptyJSON := `{}`
data, _ = jason.NewObjectFromBytes([]byte(emptyJSON))
}
return data
}