Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/controller/mongodbbackup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (

backupPhaseCompleted = "Completed"
backupPhaseFailed = "Failed"
backupPhasePassed = "Passed"
backupPhasePending = "Pending"
backupPhaseRunning = "Running"
backupPhaseRestoring = "Restoring"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (r *MongoDBBackupVerificationReconciler) Reconcile(ctx context.Context, req
v.Status.QueryResults = append(v.Status.QueryResults, results...)

if allPassed {
v.Status.Phase = "Passed"
v.Status.Phase = backupPhasePassed
} else {
v.Status.Phase = backupPhaseFailed
}
Expand Down
6 changes: 4 additions & 2 deletions internal/controller/mongodbsharded_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func ensureShardedUpgradeStartTime(mdbsh *mongodbv1alpha1.MongoDBSharded) {
// +kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=cert-manager.io,resources=certificates,verbs=get;list;watch;create;update;patch;delete

//nolint:gocyclo // 12-step reconcile orchestrator — 본질적 복잡도(step 추출 시 가독성 저하, reconcileShardedCollections 분리 완료)
func (r *MongoDBShardedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
logger := log.FromContext(ctx)
logger.Info("Reconciling MongoDBSharded", "namespace", req.Namespace, "name", req.Name)
Expand Down Expand Up @@ -838,12 +839,13 @@ func (r *MongoDBShardedReconciler) observeShardedCollections(ctx context.Context
// 변환한다. order "1"/"-1" 는 BSON 숫자로, "hashed" 는 문자열로 매핑한다 —
// MongoDB shardCollection 명령의 key 도큐먼트 컨벤션.
func buildShardKey(fields []mongodbv1alpha1.ShardKeyField) bson.D {
const orderHashed = "hashed"
key := make(bson.D, 0, len(fields))
for _, f := range fields {
var val any
switch f.Order {
case "hashed":
val = "hashed"
case orderHashed:
val = orderHashed
case "-1":
val = int32(-1)
default: // "1"
Expand Down
Loading