Commit bcd56ef4 authored by Ľuboslav Pivarč's avatar Ľuboslav Pivarč
Browse files

Fixed NP when there are pods in pending state (outOfResources cluster)

parent 8497ad6d
......@@ -7,7 +7,6 @@ import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication
@EnableAsync
public class CBioOnDemandK8SApplication {
public static void main(String[] args) {
SpringApplication.run(CBioOnDemandK8SApplication.class, args);
}
......
......@@ -3,9 +3,9 @@ package cz.muni.ics.edirex.cbioondemandK8S.model;
public enum Status {
creating,
removing,
notActive,
importing,
failedcreating,
active,
notFound, decide
notFound,
decide
}
......@@ -48,7 +48,6 @@ public class KubernetesAPI implements KubernetesCalls{
public KubernetesAPI() throws IOException {
ApiClient client = Config.defaultClient();
client.setDebugging(true);
Configuration.setDefaultApiClient(client);
api = new CoreV1Api(client);
appsApi = new AppsV1Api(client);
......
......@@ -6,6 +6,7 @@ import cz.muni.ics.edirex.cbioondemandK8S.model.InitialBody;
import cz.muni.ics.edirex.cbioondemandK8S.model.Instance;
import cz.muni.ics.edirex.cbioondemandK8S.model.Status;
import cz.muni.ics.edirex.cbioondemandK8S.model.User;
import io.kubernetes.client.models.V1ContainerStatus;
import io.kubernetes.client.models.V1EnvVar;
import io.kubernetes.client.models.V1Pod;
import io.kubernetes.client.models.V1ReplicaSet;
......@@ -331,7 +332,10 @@ public class KubernetesImpl implements CBioOnDemandService {
}
private Status retrieveStatus(V1Pod pod) {
Boolean containerReady = pod.getStatus().getContainerStatuses().get(0).isReady();
List<V1ContainerStatus> statuses = pod.getStatus().getContainerStatuses();
Boolean containerReady = false;
if (statuses != null)
containerReady = statuses.get(0).isReady();
//Pending: The pod has been accepted by the Kubernetes system, but one or more of the container images
// has not been created. This includes time before being scheduled as well as time spent downloading
// images over the network, which could take a while. Running: The pod has been bound to a node,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment