Unverified Commit 999a2c3f authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #10416 from nuwang/patch_k8s_job_name_length

Restrict k8s max job name length to 63 and shorten prefix
parents 05aa4c28 24093268
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ class KubernetesJobRunner(AsynchronousJobRunner):
    def __produce_unique_k8s_job_name(self, galaxy_internal_job_id):
        # wrapper.get_id_tag() instead of job_id for compatibility with TaskWrappers.
        instance_id = self._galaxy_instance_id or ''
        return produce_unique_k8s_job_name(app_prefix='galaxy', instance_id=instance_id, job_id=galaxy_internal_job_id)
        return produce_unique_k8s_job_name(app_prefix='gxy', instance_id=instance_id, job_id=galaxy_internal_job_id)

    def __get_k8s_job_spec(self, ajs):
        """Creates the k8s Job spec. For a Job spec, the only requirement is to have a .spec.template.
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +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

    return "{}{}-{}".format(job_name, job_id, uuid.uuid4())
    return "{}{}-{}".format(job_name, job_id, uuid.uuid4())[-63:]


def pull_policy(params):