fix(k8s): pass project context to km vectorize
All checks were successful
Code Review / ai-code-review (push) Successful in 26s
CD Pipeline / tests (push) Successful in 1m57s
CD Pipeline / build-and-deploy (push) Successful in 6m1s
CD Pipeline / post-deploy-checks (push) Successful in 38s

This commit is contained in:
Your Name
2026-06-14 08:09:39 +08:00
parent 46027e18ef
commit 8ddb80d63d
6 changed files with 72 additions and 5 deletions

View File

@@ -15,6 +15,14 @@ import sys
import httpx
def _project_headers() -> dict[str, str]:
"""Return internal API project context headers required by fail-closed RLS."""
project_id = os.environ.get("KM_PROJECT_ID", "awoooi").strip()
if not project_id:
project_id = "awoooi"
return {"X-Project-ID": project_id}
async def main() -> int:
api_base = os.environ.get(
"INTERNAL_API_URL",
@@ -24,7 +32,7 @@ async def main() -> int:
async with httpx.AsyncClient(timeout=1800) as client:
try:
resp = await client.post(url)
resp = await client.post(url, headers=_project_headers())
print(f"embed-all: {resp.status_code} {resp.text[:200]}")
if resp.status_code >= 400:
print(f"ERROR: embed-all returned {resp.status_code}", file=sys.stderr)