Add error check to heapsterclient response
Add labelSelector to pod metrics api Remove pod metrics in resources API
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user