Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions arthur/apis/kubernetes/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@

from kubernetes_asyncio import client
from kubernetes_asyncio.client.api_client import ApiClient
from kubernetes_asyncio.client.models import V1beta1CronJob, V1beta1CronJobList, V1Job
from kubernetes_asyncio.client.models import V1CronJob, V1CronJobList, V1Job


async def list_cronjobs(namespace: Optional[str] = None) -> V1beta1CronJobList:
async def list_cronjobs(namespace: Optional[str] = None) -> V1CronJobList:
"""Query the Kubernetes API for a list of cronjobss in the provided namespace."""
async with ApiClient() as api:
api = client.BatchV1beta1Api(api)
api = client.BatchV1Api(api)
if namespace:
return await api.list_namespaced_cron_job(namespace)
else:
return await api.list_cron_job_for_all_namespaces()


async def get_cronjob(namespace: str, cronjob_name: str) -> V1beta1CronJob:
async def get_cronjob(namespace: str, cronjob_name: str) -> V1CronJob:
"""Fetch a cronjob given the name and namespace."""
async with ApiClient() as api:
api = client.BatchV1beta1Api(api)
api = client.BatchV1Api(api)
return await api.read_namespaced_cron_job(cronjob_name, namespace)


Expand Down
Loading