From fab237e7ef4c8fa69e78718903a77af095de85c5 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 8 Nov 2020 22:34:04 -0800 Subject: [PATCH] fix expected master count --- controllers/controller_master.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/controller_master.go b/controllers/controller_master.go index d93a650..b375fa0 100644 --- a/controllers/controller_master.go +++ b/controllers/controller_master.go @@ -70,8 +70,8 @@ func (r *SeaweedReconciler) waitForMasterStatefulSet(seaweedCR *seaweedv1.Seawee } } - if runningCounter < len(podList.Items)/2+1 { - log.Info("some masters are not ready", "missing", len(podList.Items)-runningCounter) + if runningCounter < int(seaweedCR.Spec.Master.Replicas)/2+1 { + log.Info("some masters are not ready", "missing", int(seaweedCR.Spec.Master.Replicas)-runningCounter) return true, ctrl.Result{RequeueAfter: 3 * time.Second}, nil }