Skip to content

Commit

Permalink
Fix unsafe conversion caught by updated linter
Browse files Browse the repository at this point in the history
  • Loading branch information
nolancon committed Sep 23, 2024
1 parent b264e5e commit e68201e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/controller/bucket/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func setBucketStatus(bucket *v1alpha1.Bucket, bucketBackends *bucketBackends, pr
backends := bucketBackends.getBackends(bucket.Name, providerNames)
bucket.Status.AtProvider.Backends = backends

ok := 0
var ok uint = 0
unavailableBackends := make([]string, 0)
for backendName, backend := range backends {
if backend.BucketCondition.Equal(xpv1.Available()) {
Expand All @@ -183,13 +183,13 @@ func setBucketStatus(bucket *v1alpha1.Bucket, bucketBackends *bucketBackends, pr
}
// The Bucket CR is considered Available if the bucket is available on "minReplicas"
// number of backends (default = 1).
if ok >= int(minReplicas) {
if ok >= minReplicas {
bucket.Status.SetConditions(xpv1.Available())
}
// The Bucket CR is considered Synced (ReconcileSuccess) once the bucket is available
// on all backends. We also ensure that the overall Bucket CR is available (in a Ready
// state) - this should already be the case.
if ok >= len(providerNames) &&
if ok >= uint(len(providerNames)) &&
bucket.Status.GetCondition(xpv1.TypeReady).Equal(xpv1.Available()) {
bucket.Status.SetConditions(xpv1.ReconcileSuccess())

Expand Down

0 comments on commit e68201e

Please sign in to comment.