aboutsummaryrefslogtreecommitdiffstats
path: root/arthur/apis/kubernetes/certificates.py
blob: ab71443f0dad3d346af1accad1c5a8ed02004583 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""APIs for interacting with TLS certificates through cert-manager.io CRDs."""

from typing import Any

from kubernetes_asyncio import client
from kubernetes_asyncio.client.api_client import ApiClient


async def list_certificates(namespace: str) -> dict[str, Any]:
    """List certificate objects created through cert-manager."""
    async with ApiClient() as api_client:
        api = client.CustomObjectsApi(api_client)
        return await api.list_namespaced_custom_object(
            "cert-manager.io", "v1", namespace, "certificates"
        )