aboutsummaryrefslogtreecommitdiffstats
path: root/arthur/apis/kubernetes/jobs.py
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2023-04-27 22:28:08 +0100
committerGravatar GitHub <[email protected]>2023-04-27 22:28:08 +0100
commitfffe818885154fcc54b399f13155ee95a1a408bc (patch)
tree86ead71bb3b5d57f886b77a45455d43bfa2cd5ec /arthur/apis/kubernetes/jobs.py
parentbuild(deps): bump pydantic from 1.10.5 to 1.10.7 (#50) (diff)
parentFix linting errors from new ruff rules (diff)
Merge pull request #54 from python-discord/migrate-to-ruff
Migrate to ruff
Diffstat (limited to 'arthur/apis/kubernetes/jobs.py')
-rw-r--r--arthur/apis/kubernetes/jobs.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/arthur/apis/kubernetes/jobs.py b/arthur/apis/kubernetes/jobs.py
index a5edc53..606177c 100644
--- a/arthur/apis/kubernetes/jobs.py
+++ b/arthur/apis/kubernetes/jobs.py
@@ -1,19 +1,18 @@
"""APIs for interacting with Kubernetes Jobs & Cronjobs."""
-from typing import Any, Optional
+from typing import Any
from kubernetes_asyncio import client
from kubernetes_asyncio.client.api_client import ApiClient
from kubernetes_asyncio.client.models import V1CronJob, V1CronJobList, V1Job
-async def list_cronjobs(namespace: Optional[str] = None) -> V1CronJobList:
+async def list_cronjobs(namespace: str | None = None) -> V1CronJobList:
"""Query the Kubernetes API for a list of cronjobss in the provided namespace."""
async with ApiClient() as 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()
+ return await api.list_cron_job_for_all_namespaces()
async def get_cronjob(namespace: str, cronjob_name: str) -> V1CronJob: