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; ...@@ -7,7 +7,6 @@ import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication @SpringBootApplication
@EnableAsync @EnableAsync
public class CBioOnDemandK8SApplication { public class CBioOnDemandK8SApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(CBioOnDemandK8SApplication.class, args); SpringApplication.run(CBioOnDemandK8SApplication.class, args);
} }
......
...@@ -3,9 +3,9 @@ package cz.muni.ics.edirex.cbioondemandK8S.model; ...@@ -3,9 +3,9 @@ package cz.muni.ics.edirex.cbioondemandK8S.model;
public enum Status { public enum Status {
creating, creating,
removing, removing,
notActive,
importing, importing,
failedcreating, failedcreating,
active, active,
notFound, decide notFound,
decide
} }
...@@ -48,7 +48,6 @@ public class KubernetesAPI implements KubernetesCalls{ ...@@ -48,7 +48,6 @@ public class KubernetesAPI implements KubernetesCalls{
public KubernetesAPI() throws IOException { public KubernetesAPI() throws IOException {
ApiClient client = Config.defaultClient(); ApiClient client = Config.defaultClient();
client.setDebugging(true);
Configuration.setDefaultApiClient(client); Configuration.setDefaultApiClient(client);
api = new CoreV1Api(client); api = new CoreV1Api(client);
appsApi = new AppsV1Api(client); appsApi = new AppsV1Api(client);
......
...@@ -6,6 +6,7 @@ import cz.muni.ics.edirex.cbioondemandK8S.model.InitialBody; ...@@ -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.Instance;
import cz.muni.ics.edirex.cbioondemandK8S.model.Status; import cz.muni.ics.edirex.cbioondemandK8S.model.Status;
import cz.muni.ics.edirex.cbioondemandK8S.model.User; 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.V1EnvVar;
import io.kubernetes.client.models.V1Pod; import io.kubernetes.client.models.V1Pod;
import io.kubernetes.client.models.V1ReplicaSet; import io.kubernetes.client.models.V1ReplicaSet;
...@@ -331,7 +332,10 @@ public class KubernetesImpl implements CBioOnDemandService { ...@@ -331,7 +332,10 @@ public class KubernetesImpl implements CBioOnDemandService {
} }
private Status retrieveStatus(V1Pod pod) { 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 //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 // 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, // 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