refactor: keiailab-commons v0.11.0 채택 — 자체구현 7 표면 제거 (-1,025 LOC)#312
Merged
Conversation
3-operator 라이브러리 스타일 일관 리팩토링 (keiailab-commons#77 Phase B).
status/apply/reconcile/certmanager/reconcilemetrics/monitoring/security 의
자체구현을 commons v0.11.0 호출로 교체.
핵심 보존 검증:
- 메트릭 fqName byte-동일: mongodb_reconcile_{total,duration_seconds,
errors_total} — subsystem "mongodb" 주입, Help/bucket 12종/라벨 동일.
자체 trio init() 등록 제거 → duplicate registration 0
- 기존 단위 테스트 삭제 0 (commons 호출 검증으로 전환, 회귀 가드 유지)
의도된 거동 변화 (gate 검증 완료):
- apply.Service nil-guard: AllocateLoadBalancerNodePorts/LoadBalancerClass
server-default 보존 (기존: nil 덮어쓰기 — generation ping-pong 방어)
- apply.StatefulSet conflict 시 RetryOnConflict 재시도 (기존: 즉시 에러)
- pod-level seccompProfile=RuntimeDefault 추가 (PSA restricted 정합) —
업그레이드 시 STS/Deployment 1회 rolling restart
- exporter 3-way drift 통일: percona/mongodb_exporter 0.40 → 0.51.0
(const + v1alpha1/v1beta1 CRD default + config/charts CRD yaml 동기)
- 이미지 SSOT: backup verification mongo:8.0 → mongo:8.3.1 (defaultImage)
- ApplyErrorCondition 메시지 구분자 '- ' → ': '
- PrometheusRule 빌더 YAML string → unstructured CR 반환 (15 rule 동일)
- CI golang:1.23 → 1.26 (go.mod 정합) + Bitnami 표현 중립화
검증:
- make test (manifests+generate+fmt+vet+envtest+go test -race): 전체 PASS
- golangci-lint: 0 issues / generated drift 0
- 후속: release 시 make bundle 재생성 (OLM CSV exporter default 반영)
Refs: KeiaiLab/keiailab-commons#77
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
사용자 시나리오
operator 유지보수자가 reconcile 보일러플레이트 (idempotent apply / status condition / 에러 condition / cert 발급 / reconcile 메트릭 / PrometheusRule / SecurityContext) 를 본 repo 에서 직접 유지하지 않고
keiailab-commonsv0.11.0 한 곳에서 import 한다. 34 files, +417/−1,025.핵심 보존 검증 (게이트 agent 실측)
mongodb_reconcile_{total,duration_seconds,errors_total}—reconcilemetrics.New("mongodb")subsystem 주입. Help 3종/bucket 12종/라벨 동일. 자체 trioinit()등록 제거 → duplicate registration 0. 기존 Grafana 대시보드/알림 무영향.mongodb_*≥33 카운트 + PrometheusRule 15 rule 행동 검증 유지)의도된 거동 변화
-→:검증
후속 (release 시):
make bundle재생성으로 OLM CSV 의 exporter default 반영.Refs: KeiaiLab/keiailab-commons#77