From 60e5e69382796b6d26b351bd8afe4c6958356915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20G=C3=BCne=C5=9F?= Date: Tue, 14 Jan 2025 11:31:24 +0300 Subject: [PATCH] fix rs member after initialization --- pkg/controller/perconaservermongodb/mgo.go | 2 +- pkg/controller/perconaservermongodb/psmdb_controller.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controller/perconaservermongodb/mgo.go b/pkg/controller/perconaservermongodb/mgo.go index 742e651f9..677650cea 100644 --- a/pkg/controller/perconaservermongodb/mgo.go +++ b/pkg/controller/perconaservermongodb/mgo.go @@ -136,7 +136,7 @@ func (r *ReconcilePerconaServerMongoDB) reconcileCluster(ctx context.Context, cr LastTransitionTime: metav1.NewTime(time.Now()), }) - return api.AppStateInit, nil, nil + return api.AppStateInit, rs.Members, nil } defer func() { if err := cli.Disconnect(ctx); err != nil { diff --git a/pkg/controller/perconaservermongodb/psmdb_controller.go b/pkg/controller/perconaservermongodb/psmdb_controller.go index 293002fb7..fed64c05d 100644 --- a/pkg/controller/perconaservermongodb/psmdb_controller.go +++ b/pkg/controller/perconaservermongodb/psmdb_controller.go @@ -571,6 +571,7 @@ func (r *ReconcilePerconaServerMongoDB) reconcileReplsets(ctx context.Context, c for pod, member := range members { rs.Members[pod] = member } + log.V(1).Info("Replset members", "rs", replset.Name, "initialized", rs.Initialized, "members", rs.Members) cr.Status.Replsets[replset.Name] = rs } }