deck file validate
deck file validate 명령은 상태 파일을 읽어서 유효성을 검사해요. 지정한 모든 상태 파일을 훑으면서 YAML/JSON 파싱 오류를 한꺼번에 알려줘요. 서비스와 라우트 같은 엔티티 간 참조 관계도 확인해서 깨진 관계나 누락된 링크가 있으면 짚어줘요. 실행 중에는 decK와 Kong 사이에 통신이 없어서 온라인 검증보다 빠르지만 잡아낼 수 있는 오류는 적을 수 있다는 점도 기억해두면 좋아요
출처: 문서
본문
deck file validate kong.yaml
응답 예시:
Error: 1 errors occurred:
reading file kong.yaml: validating file content: 2 errors occurred:
validation error: object={"paths":["/demo"]}, err=services.0.routes.0: Must validate at least one schema (anyOf)
validation error: object={"paths":["/demo"]}, err=services.0.routes.0: name is required
{:.no-copy-code}
deck file validate는 외래 관계(foreign relationship)도 검사해서, 관계가 깨졌거나 링크가 누락된 경우 경고를 표시해요.
예를 들어 다음과 같은 응답이 표시될 수 있어요:
Error: building state: route demo-route for plugin rate-limiting: entity not found
{:.no-copy-code}
이 명령이 실행되는 동안에는 decK와 Kong 사이에 통신이 이루어지지 않아요. 이 방식은 온라인 검증보다 빠르지만, 더 적은 수의 오류를 잡아낼 수 있어요. 온라인 검증에 대해서는 deck gateway validate 문서를 참고하세요.
명령 사용법
Usage:
deck file validate [flags] [kong-state-files...]
Flags:
-W, --errors-as-warnings string Treat the given comma-separated diagnostic codes as warnings.
-h, --help help for validate
--konnect-compatibility validate that the state file(s) are ready to be deployed to Konnect
--online-entities-list strings indicate the list of entities that should be validated online validation.
--parallelism int Maximum number of concurrent requests to Kong. (default 10)
--rbac-resources-only indicate that the state file(s) contains RBAC resources only (Kong Enterprise only).
-E, --warnings-as-errors string Treat the given comma-separated diagnostic codes as errors.
-w, --workspace string validate configuration of a specific workspace (Kong Enterprise only).
This takes precedence over _workspace fields in state files.
관련 리소스
더 알아보기 (Learn more)
- decK가 Kong에 실제로 접속해 구성을 검증하는 온라인 검증 방법을 안내해요 — deck gateway validate