Resolve ai-service directly from the RAG routes, never the gateway

This commit is contained in:
2026-08-19 10:16:44 +07:00
parent f50ccfc5f7
commit 24c55d1627
13 changed files with 470 additions and 22 deletions
+25
View File
@@ -58,6 +58,18 @@ def main() -> int:
print(f"sync.status={app.get('status', {}).get('sync', {}).get('status')}")
print(f"health.status={app.get('status', {}).get('health', {}).get('status')}")
# The raw string, escaped -- a manual UI edit used a folded (`values: >`)
# block instead of a literal one, which silently joins same-indent lines.
# Only an escaped dump shows where the newlines really are; the pretty
# print below looks almost right and hides it.
print("--- spec.source.helm.values RAW (first line + newline positions) ---")
raw = app["spec"]["source"]["helm"].get("values", "")
for i, line in enumerate(raw.splitlines()):
safe = re.sub(r"(?i)(password|secret|jwt)[^\s]*:.*", r"\1<redacted>", line)
print(f"{i:>3}: {safe!r}")
print("--- end raw ---")
print("--- spec.source.helm.values (secrets redacted) ---")
for line in values.splitlines():
print(redact(line))
@@ -78,6 +90,19 @@ def main() -> int:
print(f"{c.get('type')}: {c.get('message')}")
print("--- end conditions ---")
op = app.get("status", {}).get("operationState", {})
print("--- status.operationState (last sync operation) ---")
print(f"phase={op.get('phase')}")
print(f"message={op.get('message')}")
print(f"startedAt={op.get('startedAt')} finishedAt={op.get('finishedAt')}")
sync_res = op.get("syncResult") or {}
for r in sync_res.get("resources", []):
print(
f" {r.get('kind'):<12} {r.get('name'):<45} "
f"status={r.get('status')} hookPhase={r.get('hookPhase')} message={r.get('message')}"
)
print("--- end operationState ---")
print("--- resource tree (nodes with non-empty health/status) ---")
try:
tree = call(base, "GET", f"/api/v1/applications/{APP_NAME}/resource-tree", token=token)