Skip to content

Commit

Permalink
change job naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-rocket committed May 8, 2024
1 parent c48e358 commit d18092a
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/k8s_job_scheduler/job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ def create_instant_python_job(
spec=client.V1PodSpec(
restart_policy="Never", containers=[container]
),
metadata=client.V1ObjectMeta(
name=pod_name, labels={"pod_name": pod_name}
),
metadata=client.V1ObjectMeta(name=pod_name, labels=labels),
),
),
),
Expand All @@ -244,7 +242,7 @@ def create_instant_cli_job(self, cmd, *args, **kwargs):

job_name = _gen_id("inst-job-cli", cmd, dt_scheduled)
pod_name = _gen_id("pod", cmd, dt_scheduled)
labels = {"job_name": job_name, "type": "scheduled_cli", "cmd": cmd}
labels = {"job_name": job_name, "type": "instant_cli", "cmd": cmd}

if "labels" in kwargs:
labels.update(kwargs["labels"])
Expand All @@ -264,9 +262,7 @@ def create_instant_cli_job(self, cmd, *args, **kwargs):
spec=client.V1PodSpec(
restart_policy="Never", containers=[container]
),
metadata=client.V1ObjectMeta(
name=pod_name, labels={"pod_name": pod_name}
),
metadata=client.V1ObjectMeta(name=pod_name, labels=labels),
),
),
),
Expand Down Expand Up @@ -333,9 +329,7 @@ def create_scheduled_cli_job(self, schedule, cmd, *args, **kwargs):
),
),
),
metadata=client.V1ObjectMeta(
name=pod_name, labels={"pod_name": pod_name}
),
metadata=client.V1ObjectMeta(name=pod_name, labels=labels),
),
),
),
Expand Down

0 comments on commit d18092a

Please sign in to comment.