Skip to content

Commit c5c9654

Browse files
committed
K8SPG-782 assign patroni version to status when patroni label is configured through the cr option
1 parent 2f1e9ce commit c5c9654

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

percona/controller/pgcluster/controller.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,15 @@ func (r *PGClusterReconciler) reconcilePatroniVersionCheck(ctx context.Context,
337337

338338
if patroniVersion, ok := cr.Annotations[pNaming.AnnotationCustomPatroniVersion]; ok {
339339
cr.Annotations[pNaming.AnnotationPatroniVersion] = patroniVersion
340+
341+
orig := cr.DeepCopy()
342+
343+
cr.Status.PatroniVersion = patroniVersion
344+
345+
if err := r.Client.Status().Patch(ctx, cr.DeepCopy(), client.MergeFrom(orig)); err != nil {
346+
return errors.Wrap(err, "failed to patch patroni version")
347+
}
348+
340349
return nil
341350
}
342351

0 commit comments

Comments
 (0)