Use generated uuid instead of galaxy job id for k8s job name

Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
This commit is contained in:
Nuwan Goonasekera
2020-10-06 19:02:54 +05:30
co-authored by Marius van den Beek
parent 3b427177fc
commit 488baee52a
+1 -5
View File
@@ -1,9 +1,7 @@
"""Interface layer for pykube library shared between Galaxy and Pulsar."""
import logging
import os
import random
import re
import string
import uuid
try:
@@ -59,9 +57,7 @@ def produce_unique_k8s_job_name(app_prefix=None, instance_id=None, job_id=None):
if instance_id and len(instance_id) > 0:
job_name += "%s-" % instance_id
unique_id = ''.join(random.choices(string.ascii_lowercase, k=4))
return job_name + job_id + "-" + unique_id
return "{}{}-{}".format(job_name, job_id, uuid.uuid4())
def pull_policy(params):