Skip to content

Commit

Permalink
small tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
nolancon committed Jan 21, 2025
1 parent 3bfce29 commit 950feaf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/controller/bucket/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func (c *external) Update(ctx context.Context, mg resource.Managed) (managed.Ext

// Whether buckets are updated successfully or not on backends, we need to update the
// Bucket CR Status in all cases to represent the conditions of each individual bucket.
cls := c.backendStore.GetBackendS3Clients(allBackendsToUpdateOnNames)
if err := c.updateBucketCR(ctx, bucket,
func(bucketLatest *v1alpha1.Bucket) UpdateRequired {
setBucketStatus(bucketLatest, bucketBackends, allBackendsToUpdateOnNames, c.minReplicas)
Expand All @@ -98,7 +97,13 @@ func (c *external) Update(ctx context.Context, mg resource.Managed) (managed.Ext

// Auto pause the Bucket CR if required - ie if auto-pause has been enabled and the
// criteria is met before pausing a Bucket CR.
if isPauseRequired(bucketLatest, allBackendsToUpdateOnNames, cls, bucketBackends, c.autoPauseBucket) {
if isPauseRequired(
bucketLatest,
allBackendsToUpdateOnNames,
c.backendStore.GetBackendS3Clients(allBackendsToUpdateOnNames),
bucketBackends,
c.autoPauseBucket,
) {
c.log.Info("Auto pausing bucket", consts.KeyBucketName, bucket.Name)
bucketLatest.Labels[meta.AnnotationKeyReconciliationPaused] = True
}
Expand Down

0 comments on commit 950feaf

Please sign in to comment.