Added more spagetti
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-04-19 17:04:24 +02:00
parent 2c316eeebf
commit 461ed329e4

View File

@ -25,7 +25,23 @@ class JobView(FlaskView):
# Meglátjuk mennyire lesz ez robosztus így
pod_name = JobView._controller_to_pod_name(controller)
r = k8s.corev1api.read_namespaced_pod(pod_name, current_app.config['WORKING_NAMESPACE'])
try:
r = k8s.corev1api.read_namespaced_pod(pod_name, current_app.config['WORKING_NAMESPACE'])
except kubernetes.client.exceptions.ApiException as e:
if e.status == 404:
return {
"pod_name": pod_name,
"config": {
"robot_address": None,
"program_url": None,
},
"status": {
"cluster_ip": None,
"phase": None
}
}
else:
raise
env = {x.name: x.value for x in r.spec.containers[0].env}