Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: rakeshgm <[email protected]>
  • Loading branch information
rakeshgm authored and BenamarMk committed Jan 23, 2024
1 parent 303b5ff commit 040137e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions controllers/s3utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,13 @@ func (s *s3ObjectStore) DeleteObject(key string) error {
Bucket: aws.String(s.s3Bucket),
Key: aws.String(key),
})
if err != nil {
errMsgPrefix := fmt.Errorf("failed to delete object %s", *aws.String(key))

return processAwsError(errMsgPrefix, err)
}

return err
return nil
}

// DeleteObjectsWithKeyPrefix deletes from the bucket any objects that
Expand Down Expand Up @@ -643,9 +648,16 @@ func (s *s3ObjectStore) DeleteObjects(keys ...string) error {
ctx, cancel := context.WithDeadline(context.TODO(), time.Now().Add(s3Timeout))
defer cancel()

return s.batchDeleter.Delete(ctx, &s3manager.DeleteObjectsIterator{
err := s.batchDeleter.Delete(ctx, &s3manager.DeleteObjectsIterator{
Objects: delObjects,
})
if err != nil {
errMsgPrefix := fmt.Errorf("unable to process batch delete")

return processAwsError(errMsgPrefix, err)
}

return nil
}

// isAwsErrCodeNoSuchBucket returns true if the given input `err` has wrapped
Expand Down

0 comments on commit 040137e

Please sign in to comment.