fix(admin): show live OpenStack instance status instead of stale DB value#78
Merged
Conversation
…alue
Admin dashboard read the persisted instance status from the DB, which is
written once at creation ("BUILD") and never refreshed, so instances showed
"생성 중" indefinitely. The user-facing compute views already overlay the
live OpenStack status; admin now does the same.
Adds an instanceStatusSource backed by the existing compute.Client (single
OpenStack project, so one servers.List covers every user's instances) and
overlays live status in admin Instances/Instance/UserResources. Best-effort:
falls back to the DB value when the live fetch fails so a single OpenStack
hiccup never breaks the whole admin dashboard.
The overlay logic lives in the service, so test it by calling the service methods directly instead of routing through the gin stack, auth middleware, and JSON round-trip (endpoint authz is already covered elsewhere). Adds createTestUser/createTestInstance helpers to drop duplicated setup.
12a1d4d to
1a7c9da
Compare
Choi-Eunseok
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
어드민 대시보드에서 며칠 전 생성한 인스턴스가 계속 "생성 중(BUILD)”으로 표시되던 버그 수정.
원인
어드민 API는 DB에 저장된
status를 그대로 노출했는데, 이 값은 인스턴스 생성 시 한 번("BUILD") 기록되고 이후 어디서도 갱신되지 않음. 반면 일반 Compute 화면은 OpenStack을 실시간 조회해srv.Status를 사용하므로 정상 표시됨. 즉 어드민만 stale한 DB 값을 보여주고 있었음.수정
어드민도 일반 Compute와 동일하게 라이브 OpenStack 상태를 overlay.
instanceStatusSource인터페이스 추가, 기존compute.Client를 재사용(단일 OpenStack
프로젝트라
servers.List한 번으로 전 유저 인스턴스 커버, 같은provider 재사용)
Instances/Instance/UserResources에서 DB 조회 후 라이브 상태로덮어씀
장애가 어드민 전체를 깨지 않음
변경 파일
internal/domain/admin/instance_status.go(신규) — compute.Client 기반 라이브 상태 소스internal/domain/admin/service.go— overlay 로직internal/domain/admin/init.go—WithLiveInstanceStatusSource옵션internal/server/app.go— provider 와이어링internal/domain/admin/handler_test.go— 회귀 테스트