diff options
| author | 2023-03-02 22:34:31 +0000 | |
|---|---|---|
| committer | 2023-03-02 22:34:31 +0000 | |
| commit | b5f30bfa6ac388d369c09ff89f33a5d61e661d2a (patch) | |
| tree | 69dab6563af7cb40fc71456a613b4a3b3df4c9ab /arthur/apis/kubernetes/jobs.py | |
| parent | Merge pull request #44 from shtlrs/bump-pydis-core-to-950 (diff) | |
| parent | Don't use the beta1 APIs for cronjobs (diff) | |
Merge pull request #45 from python-discord/Fix-cronjob-integrations
Fix cronjob integrations
Diffstat (limited to 'arthur/apis/kubernetes/jobs.py')
| -rw-r--r-- | arthur/apis/kubernetes/jobs.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arthur/apis/kubernetes/jobs.py b/arthur/apis/kubernetes/jobs.py index c079da0..a5edc53 100644 --- a/arthur/apis/kubernetes/jobs.py +++ b/arthur/apis/kubernetes/jobs.py @@ -3,23 +3,23 @@ from typing import Any, Optional 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) |