cli v0.12.3: 소스 프로비저닝 엔드포인트 수정 — POST /services(clusterId in body). /clusters/{id}/services 는 GET전용이라 405 나던 것(board6 '권한' 오진 실은 잘못된 엔드포인트)

This commit is contained in:
2026-08-28 06:19:19 +09:00
parent d2de054b3b
commit 2281039c1b
2 changed files with 6 additions and 10 deletions

View File

@ -14,7 +14,7 @@ set -uo pipefail # -e 미사용: 'test && action' 관용구가 값 없을 때
REPO="${YAKCLOUD_STARTER_REPO:-https://gitea.yakenator.io/yakenator/yakcloud-starter}"
BRANCH="${YAKCLOUD_STARTER_BRANCH:-main}"
VERSION="0.12.2"
VERSION="0.12.3"
CONFIG_DIR="${YAKCLOUD_CONFIG_DIR:-$HOME/.config/yakcloud}"
CONFIG_FILE="$CONFIG_DIR/config"

View File

@ -100,25 +100,21 @@ def reconcile_source(req: dict) -> str | None:
log(f"source '{name}' ({stype}) 이미 READY → 스킵 (id={match['id']})")
return match["id"]
if DRY:
# 배포 토큰으로는 소스 생성이 막힐 수 있으므로, 없으면 미리 경고(실패 예측).
if match:
log(f"source '{name}' 상태={match.get('status')} — READY 대기 필요")
else:
log(f"source '{name}' 없음 — 배포 토큰으론 생성 불가할 수 있음. "
f"콘솔에서 만들거나 requires[].name/binds[].source 를 기존 READY 소스로 지정. 현재 READY: {_ready_sources()}")
log(f"source '{name}' ({stype}, {plan}) 없음 → 프로비저닝 예정(POST /services). 현재 READY: {_ready_sources()}")
return None
if not match:
log(f"source '{name}' ({stype}, {plan}) 프로비저닝 시도…")
try:
api("POST", f"/clusters/{CLUSTER}/services",
# 소스 생성 = POST /services (clusterId 는 body). /clusters/{id}/services 는 GET 전용.
api("POST", "/services",
{"clusterId": CLUSTER, "type": stype, "name": name, "mode": "local", "size": plan})
except SystemExit as e:
# 405/403 등 — 이 토큰으로 생성 불가. 행동 가능한 안내로 전환.
raise SystemExit(
f"소스 '{name}' 자동 생성 불가(배포 토큰 권한). 콘솔에서 소스를 만든 뒤 "
f"requires[].name·binds[].source 를 기존 소스명으로 지정하세요.\n"
f" 현재 READY 소스: {_ready_sources()}\n"
f" (원인: {e})")
f"소스 '{name}' 생성 실패 — 콘솔에서 소스를 만든 뒤 requires[].name·binds[].source 를 그 소스명으로 "
f"지정하거나 다시 시도하세요.\n 현재 READY 소스: {_ready_sources()}\n (원인: {e})")
for _ in range(120): # ~10분
s = next((s for s in cluster_services() if s.get("name") == name), None)
if s and s.get("status") == "READY":