Skip to content

Commit 4b3a334

Browse files
committed
fix: linter issues
fix lll linter error by adjusting line length Signed-off-by: Tarun Gupta Akirala <[email protected]>
1 parent 9371d0b commit 4b3a334

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

controller/pkg/bucketclaim/bucketclaim.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ func (b *BucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
224224

225225
err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
226226
// Fetch the latest version of the BucketClaim
227-
latest, getErr := b.bucketClaims(bucketClaim.Namespace).Get(ctx, bucketClaim.Name, metav1.GetOptions{})
227+
latest, getErr := b.bucketClaims(bucketClaim.Namespace).Get(
228+
ctx,
229+
bucketClaim.Name,
230+
metav1.GetOptions{},
231+
)
228232
if getErr != nil {
229233
return getErr
230234
}
@@ -235,7 +239,11 @@ func (b *BucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
235239

236240
// Try to update the status
237241
var updateErr error
238-
bucketClaim, updateErr = b.bucketClaims(bucketClaim.Namespace).UpdateStatus(ctx, latest, metav1.UpdateOptions{})
242+
bucketClaim, updateErr = b.bucketClaims(bucketClaim.Namespace).UpdateStatus(
243+
ctx,
244+
latest,
245+
metav1.UpdateOptions{},
246+
)
239247
return updateErr
240248
})
241249
if err != nil {
@@ -248,7 +256,11 @@ func (b *BucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
248256
// Update with retry logic for conflict errors
249257
err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
250258
// Fetch the latest version of the BucketClaim
251-
latest, getErr := b.bucketClaims(bucketClaim.Namespace).Get(ctx, bucketClaim.Name, metav1.GetOptions{})
259+
latest, getErr := b.bucketClaims(bucketClaim.Namespace).Get(
260+
ctx,
261+
bucketClaim.Name,
262+
metav1.GetOptions{},
263+
)
252264
if getErr != nil {
253265
return getErr
254266
}
@@ -258,7 +270,11 @@ func (b *BucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
258270

259271
// Try to update
260272
var updateErr error
261-
bucketClaim, updateErr = b.bucketClaims(bucketClaim.Namespace).Update(ctx, latest, metav1.UpdateOptions{})
273+
bucketClaim, updateErr = b.bucketClaims(bucketClaim.Namespace).Update(
274+
ctx,
275+
latest,
276+
metav1.UpdateOptions{},
277+
)
262278
return updateErr
263279
})
264280
if err != nil {

controller/pkg/bucketclaim/bucketclaim_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,11 @@ func TestRetryOnConflictStatusUpdate(t *testing.T) {
390390
defer wg.Done()
391391
for i := range 10 {
392392
// Fetch and update the BucketClaim to change its resourceVersion
393-
bc, getErr := client.ObjectstorageV1alpha1().BucketClaims(bucketClaim.Namespace).Get(ctx, bucketClaim.Name, metav1.GetOptions{})
393+
bc, getErr := client.ObjectstorageV1alpha1().BucketClaims(bucketClaim.Namespace).Get(
394+
ctx,
395+
bucketClaim.Name,
396+
metav1.GetOptions{},
397+
)
394398
if getErr != nil {
395399
return
396400
}
@@ -399,7 +403,11 @@ func TestRetryOnConflictStatusUpdate(t *testing.T) {
399403
bc.Annotations = make(map[string]string)
400404
}
401405
bc.Annotations[fmt.Sprintf("test-%d", i)] = "value"
402-
_, _ = client.ObjectstorageV1alpha1().BucketClaims(bc.Namespace).Update(ctx, bc, metav1.UpdateOptions{})
406+
_, _ = client.ObjectstorageV1alpha1().BucketClaims(bc.Namespace).Update(
407+
ctx,
408+
bc,
409+
metav1.UpdateOptions{},
410+
)
403411
}
404412
}()
405413

@@ -413,7 +421,11 @@ func TestRetryOnConflictStatusUpdate(t *testing.T) {
413421
wg.Wait()
414422

415423
// Verify the final state - status should be updated correctly
416-
updatedClaim, err := client.ObjectstorageV1alpha1().BucketClaims(bucketClaim.Namespace).Get(ctx, bucketClaim.Name, metav1.GetOptions{})
424+
updatedClaim, err := client.ObjectstorageV1alpha1().BucketClaims(bucketClaim.Namespace).Get(
425+
ctx,
426+
bucketClaim.Name,
427+
metav1.GetOptions{},
428+
)
417429
if err != nil {
418430
t.Fatalf("Error occurred when reading BucketClaim: %v", err)
419431
}

0 commit comments

Comments
 (0)