This commit is contained in:
parent
d8d20f0a78
commit
e11b41f67a
@ -213,10 +213,14 @@ class JobView(FlaskView):
|
||||
else:
|
||||
raise
|
||||
|
||||
if r.status.phase not in ['Succeeded', 'Failed']:
|
||||
r = requests.post(f"http://{r.status.pod_ip}:{self.CONTROLLER_HTTP_PORT}/abort")
|
||||
r.raise_for_status()
|
||||
self._k8s_wait_pod_phase(pod_name, ['Succeeded', 'Failed'])
|
||||
if r.status.phase == 'Running':
|
||||
try:
|
||||
r = requests.post(f"http://{r.status.pod_ip}:{self.CONTROLLER_HTTP_PORT}/abort")
|
||||
r.raise_for_status()
|
||||
self._k8s_wait_pod_phase(pod_name, ['Succeeded', 'Failed'])
|
||||
except requests.exceptions.ConnectionError:
|
||||
# Ignore failure to abort, k8s will kill the pod anyways
|
||||
pass
|
||||
|
||||
try:
|
||||
k8s.corev1api.delete_namespaced_pod(pod_name, current_app.config['WORKING_NAMESPACE'])
|
||||
|
Loading…
Reference in New Issue
Block a user