cli v0.11.1: environments env 클러스터가 저장/전역 YAKCLOUD_CLUSTER 보다 우선(폴백 강등) — dev/prod 해석 정확화

This commit is contained in:
2026-08-28 05:19:31 +09:00
parent dd6cf8a880
commit 2517615913
3 changed files with 6 additions and 4 deletions

View File

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

View File

@ -63,8 +63,9 @@ def cluster_ref(m: dict) -> str:
# 조회/설정은 기본 개발 환경 클러스터 기준. environments.<env>.cluster → 하위호환 cluster:. # 조회/설정은 기본 개발 환경 클러스터 기준. environments.<env>.cluster → 하위호환 cluster:.
env = os.environ.get("YAKCLOUD_ENV", "dev") env = os.environ.get("YAKCLOUD_ENV", "dev")
envs = m.get("environments") or {} envs = m.get("environments") or {}
ref = (os.environ.get("YAKCLOUD_CLUSTER") # env 클러스터 최우선(저장/전역 YAKCLOUD_CLUSTER 는 하위호환 폴백).
or (envs.get(env) or {}).get("cluster") or m.get("cluster")) ref = ((envs.get(env) or {}).get("cluster")
or os.environ.get("YAKCLOUD_CLUSTER") or m.get("cluster"))
if not ref: if not ref:
sys.exit(" ✗ 대상 클러스터 미지정 — yakcloud.yaml 의 environments.%s.cluster (또는 YAKCLOUD_CLUSTER)" % env) sys.exit(" ✗ 대상 클러스터 미지정 — yakcloud.yaml 의 environments.%s.cluster (또는 YAKCLOUD_CLUSTER)" % env)
return ref return ref

View File

@ -211,7 +211,8 @@ def main() -> None:
# 환경 해석: environments.<ENV>.{cluster,domains}. 하위호환: 없으면 top-level cluster:. # 환경 해석: environments.<ENV>.{cluster,domains}. 하위호환: 없으면 top-level cluster:.
envs = m.get("environments") or {} envs = m.get("environments") or {}
env_cfg = envs.get(ENV) or {} env_cfg = envs.get(ENV) or {}
ref = CLUSTER_REF or env_cfg.get("cluster") or m.get("cluster") # environments 의 env 클러스터가 최우선(저장/전역 YAKCLOUD_CLUSTER 는 하위호환 폴백만).
ref = env_cfg.get("cluster") or CLUSTER_REF or m.get("cluster")
if not ref: if not ref:
raise SystemExit( raise SystemExit(
f"환경 '{ENV}' 대상 클러스터 미지정 — 매니페스트 environments.{ENV}.cluster (또는 YAKCLOUD_CLUSTER). " f"환경 '{ENV}' 대상 클러스터 미지정 — 매니페스트 environments.{ENV}.cluster (또는 YAKCLOUD_CLUSTER). "