fix empty node list

This commit is contained in:
Eugenio Marzo
2021-03-27 17:48:36 +01:00
parent 4840038d04
commit 6312aa0450
+5 -1
View File
@@ -123,7 +123,11 @@ function getPods(){
var oReq = new XMLHttpRequest();
oReq.onload = function () {
json_parsed = JSON.parse(this.responseText)
pods = json_parsed["items"].concat(nodes);
if (nodes && nodes.length > 0){
pods = json_parsed["items"].concat(nodes);
} else {
pods = json_parsed["items"];
}
};;
oReq.open("GET", "https://ENDPOINT_PLACEHOLDER/kube/pods?action=list&namespace=" + namespace);
oReq.send();