Skip to content

Commit

Permalink
nit: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nolancon committed Jun 27, 2024
1 parent 8502e7c commit 56e25b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions internal/controller/bucket/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func isBucketPaused(bucket *v1alpha1.Bucket) bool {
}

// isPauseRequired determines if the Bucket should be paused.
//
//nolint:gocyclo,cyclop // Function requires numerous checks.
func isPauseRequired(bucket *v1alpha1.Bucket, providerNames []string, minReplicas uint, c map[string]backendstore.S3Client, bb *bucketBackends, autopauseEnabled bool) bool {
// If the number of backends on which the bucket is available is less than the number of providerNames or minReplicas, then the bucket must not be paused.
if float64(bb.countBucketsAvailableOnBackends(bucket.Name, providerNames, c)) < math.Min(float64(len(providerNames)), float64(minReplicas)) {
Expand Down
8 changes: 4 additions & 4 deletions internal/controller/bucket/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func TestUpdateLifecycleConfigSubResource(t *testing.T) {
ForProvider: v1alpha1.BucketParameters{
LifecycleConfiguration: &v1alpha1.BucketLifecycleConfiguration{
Rules: []v1alpha1.LifecycleRule{
v1alpha1.LifecycleRule{
{
Status: "Enabled",
},
},
Expand Down Expand Up @@ -566,7 +566,7 @@ func TestUpdateLifecycleConfigSubResource(t *testing.T) {
ForProvider: v1alpha1.BucketParameters{
LifecycleConfiguration: &v1alpha1.BucketLifecycleConfiguration{
Rules: []v1alpha1.LifecycleRule{
v1alpha1.LifecycleRule{
{
Status: "Enabled",
},
},
Expand Down Expand Up @@ -632,7 +632,7 @@ func TestUpdateLifecycleConfigSubResource(t *testing.T) {
ForProvider: v1alpha1.BucketParameters{
LifecycleConfiguration: &v1alpha1.BucketLifecycleConfiguration{
Rules: []v1alpha1.LifecycleRule{
v1alpha1.LifecycleRule{
{
Status: "Enabled",
},
},
Expand Down Expand Up @@ -701,7 +701,7 @@ func TestUpdateLifecycleConfigSubResource(t *testing.T) {
ForProvider: v1alpha1.BucketParameters{
LifecycleConfiguration: &v1alpha1.BucketLifecycleConfiguration{
Rules: []v1alpha1.LifecycleRule{
v1alpha1.LifecycleRule{
{
Status: "Enabled",
},
},
Expand Down

0 comments on commit 56e25b6

Please sign in to comment.