Skip to content

Commit

Permalink
Check that bucket is Ready before making Synced
Browse files Browse the repository at this point in the history
  • Loading branch information
nolancon committed May 31, 2024
1 parent c532b0e commit 9c4d2e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/controller/bucket/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c4d2e3

Please sign in to comment.