Delete the job first to prevent Kubernetes from starting another pod
This commit is contained in:
parent
2caa82d091
commit
5e1a117ff3
1 changed files with 6 additions and 6 deletions
|
@ -408,6 +408,12 @@ class KubernetesExecutor(BuilderExecutor):
|
|||
def stop_builder(self, builder_id):
|
||||
pods_path = '/api/v1/namespaces/%s/pods' % self.namespace
|
||||
|
||||
# Delete the job itself.
|
||||
try:
|
||||
yield From(self._request('DELETE', self._job_path(builder_id)))
|
||||
except:
|
||||
logger.exception('Failed to send delete job call for job %s', builder_id)
|
||||
|
||||
# Delete the pod(s) for the job.
|
||||
selectorString = "job-name=%s" % builder_id
|
||||
try:
|
||||
|
@ -415,12 +421,6 @@ class KubernetesExecutor(BuilderExecutor):
|
|||
except:
|
||||
logger.exception("Failed to send delete pod call for job %s", builder_id)
|
||||
|
||||
# Delete the job itself.
|
||||
try:
|
||||
yield From(self._request('DELETE', self._job_path(builder_id)))
|
||||
except:
|
||||
logger.exception('Failed to send delete job call for job %s', builder_id)
|
||||
|
||||
|
||||
class LogPipe(threading.Thread):
|
||||
""" Adapted from http://codereview.stackexchange.com/a/17959
|
||||
|
|
Reference in a new issue