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

fixed bug when instance is being deleted but we intercept object of this instance

parent f80243f1
Pipeline #27152 passed with stages
in 15 minutes and 14 seconds
......@@ -149,7 +149,8 @@ public class KubernetesImpl implements CBioOnDemandService {
String label = APP_LABELS +", user=" + user.getUserId() + ", instance=" +
replicaSet.getMetadata().getLabels().get("instance");
long expireTime = getExpireDate(label);
if (expireTime == -1)
continue;
String url = getURL(labels.get("instance"));
if(url == null)
continue;
......@@ -360,7 +361,7 @@ public class KubernetesImpl implements CBioOnDemandService {
private long getExpireDate(String labels) {
List<V1beta1CronJob> result = api.getCroneJobs(labels, NAMESPACE);
if (result == null)
if (result == null || result.isEmpty())
return -1;
V1beta1CronJob job = result.get(0);
return Utils.getExpireTimeFromCronExpresion(job.getSpec().getSchedule());
......
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