Add standalone managed ingress diagnostics

This commit is contained in:
2026-08-03 19:59:12 +02:00
parent 6163c5992f
commit d107d94fec
4 changed files with 93 additions and 3 deletions
+15 -3
View File
@@ -200,12 +200,24 @@ if not location.startswith("https://localhost"):
]
)
except subprocess.CalledProcessError:
logs = _run(["docker", "logs", container], check=False).stdout.strip()
if logs:
print(f"managed ingress logs:\n{logs}", file=sys.stderr)
_print_container_diagnostics(container)
raise
def _print_container_diagnostics(container: str) -> None:
state = _run(
["docker", "inspect", "--format", "{{json .State}}", container],
check=False,
)
state_detail = (state.stdout + state.stderr).strip()
if state_detail:
print(f"managed ingress state:\n{state_detail}", file=sys.stderr)
logs = _run(["docker", "logs", container], check=False)
log_detail = (logs.stdout + logs.stderr).strip()
if log_detail:
print(f"managed ingress logs:\n{log_detail}", file=sys.stderr)
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--caddy-image", required=True)