From b80fb7ca7c7096fb0b60c38488c76fa8965c9614 Mon Sep 17 00:00:00 2001 From: anishakj <43978302+anishakj@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:43:45 +0530 Subject: [PATCH] Issue 220: Fix for intermittent bookkeeper cluster upgrade failure (#237) Signed-off-by: anisha.kj --- controllers/upgrade.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers/upgrade.go b/controllers/upgrade.go index 0953b60..7b063c6 100644 --- a/controllers/upgrade.go +++ b/controllers/upgrade.go @@ -282,6 +282,14 @@ func (r *BookkeeperClusterReconciler) syncBookkeeperVersion(bk *bookkeeperv1alph } if pod == nil { + pods, err := r.getStsPodsWithVersion(sts, bk.Status.TargetVersion) + if err != nil { + return false, err + } + if *sts.Spec.Replicas == (int32)(len(pods)) { + log.Infof("All bookkeeper pods are updated") + return false, nil + } return false, fmt.Errorf("could not obtain outdated pod") }