diff --git a/html5/kubeinvaders.js b/html5/kubeinvaders.js index 83b5344..794fbe3 100644 --- a/html5/kubeinvaders.js +++ b/html5/kubeinvaders.js @@ -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();