Skip to content

Commit

Permalink
only list the job owned by cronjob instead of all jobs
Browse files Browse the repository at this point in the history
Signed-off-by: Jimil Desai <[email protected]>
  • Loading branch information
jimil749 committed Jan 15, 2024
1 parent 7e07cbe commit 487729d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def backup(bucket_name):
).items

# list all running "backup" jobs
running_jobs = [job for job in jobs if job.status.active is not None]
# get the jobs by parent id
running_jobs = [job for job in jobs if job.status.active is not None and job.metadata.owner_references and job.metadata.owner_references[0].name == os.environ["PARENT_NAME"]
print("running jobs: ")
for j in running_jobs:
print(j.metadata.name)
Expand Down

0 comments on commit 487729d

Please sign in to comment.