fix(ai): query ai namespace instead of serviceaccount namespace

This commit is contained in:
Brad Stein 2025-12-21 01:16:17 -03:00
parent dfe409c475
commit 059f4cd291

View File

@ -216,10 +216,8 @@ def _discover_ai_meta() -> dict[str, str]:
try:
token = token_path.read_text().strip()
namespace = ns_path.read_text().strip() or AI_K8S_NAMESPACE
api_server = os.getenv("KUBERNETES_SERVICE_HOST", "kubernetes.default.svc")
api_port = os.getenv("KUBERNETES_SERVICE_PORT", "443")
base_url = f"https://{api_server}:{api_port}"
namespace = AI_K8S_NAMESPACE
base_url = "https://kubernetes.default.svc"
pod_url = f"{base_url}/api/v1/namespaces/{namespace}/pods?labelSelector={AI_K8S_LABEL}"
with httpx.Client(verify=str(ca_path), timeout=HTTP_CHECK_TIMEOUT_SEC, headers={"Authorization": f"Bearer {token}"}) as client: