Skip to content

Commit 30ef98d

Browse files
egegunesjvpasinatto
authored andcommitted
fix
1 parent 9387126 commit 30ef98d

File tree

1 file changed

+6
-0
lines changed
  • pkg/controller/perconaservermongodb

1 file changed

+6
-0
lines changed

pkg/controller/perconaservermongodb/smart.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,24 +113,30 @@ func (r *ReconcilePerconaServerMongoDB) smartUpdate(ctx context.Context, cr *api
113113

114114
if rsStatus, ok := cr.Status.Replsets[replset.Name]; !ok || !rsStatus.Initialized {
115115
log.Info("replset wasn't initialized. Continuing smart update", "replset", replset.Name)
116+
116117
for _, pod := range list.Items {
117118
log.Info("apply changes to pod", "pod", pod.Name)
118119

119120
if err := updatePod(&pod); err != nil {
120121
return err
121122
}
122123
}
124+
123125
log.Info("smart update finished for statefulset", "statefulset", sfs.Name)
126+
124127
return nil
125128
}
126129

127130
if rsStatus, ok := cr.Status.Replsets[replset.Name]; ok {
128131
for _, pod := range list.Items {
129132
if _, ok := rsStatus.Members[pod.Name]; !ok {
130133
log.Info("pod is not a member of replset, updating it", "pod", pod.Name, "replset", replset.Name)
134+
131135
if err := updatePod(&pod); err != nil {
132136
return err
133137
}
138+
139+
return nil
134140
}
135141
}
136142
}

0 commit comments

Comments
 (0)