From 9c4d2e3e25e066a3f1cf746cc73f6beddfd54601 Mon Sep 17 00:00:00 2001 From: nolancon Date: Thu, 30 May 2024 13:23:48 +0000 Subject: [PATCH] Check that bucket is Ready before making Synced --- internal/controller/bucket/helpers.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/controller/bucket/helpers.go b/internal/controller/bucket/helpers.go index 051fc388..02433690 100644 --- a/internal/controller/bucket/helpers.go +++ b/internal/controller/bucket/helpers.go @@ -160,8 +160,10 @@ func setBucketStatus(bucket *v1alpha1.Bucket, bucketBackends *bucketBackends, pr bucket.Status.SetConditions(xpv1.Available()) } // The Bucket CR is considered Synced (ReconcileSuccess) once the bucket is available - // on the lesser of all backends or minimum replicas. - if float64(ok) >= math.Min(float64(len(providerNames)), float64(minReplicas)) { + // on the lesser of all backends or minimum replicas. We also ensure that the overall + // Bucket CR is available (in a Ready state) - this should already be the case. + if float64(ok) >= math.Min(float64(len(providerNames)), float64(minReplicas)) && + bucket.Status.GetCondition(xpv1.TypeReady).Equal(xpv1.Available()) { bucket.Status.SetConditions(xpv1.ReconcileSuccess()) return