Skip to content

Commit

Permalink
r/aws_s3_bucket: Use 'emptyBucket' in sweeper.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Nov 30, 2023
1 parent 27b2c8d commit dbdbd12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/service/s3/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func sweepObjects(region string) error {
}
conn := client.S3Client(ctx)

// General-purpose buckets.
// General purpose buckets.
output, err := conn.ListBuckets(ctx, &s3.ListBucketsInput{})

if awsv2.SkipSweepError(err) {
Expand Down Expand Up @@ -138,7 +138,7 @@ type objectSweeper struct {

func (os objectSweeper) Delete(ctx context.Context, timeout time.Duration, optFns ...tfresource.OptionsFunc) error {
// Delete everything including locked objects.
_, err := deleteAllObjectVersions(ctx, os.conn, os.bucket, "", os.locked, true)
_, err := emptyBucket(ctx, os.conn, os.bucket, os.locked)
if err != nil {
return fmt.Errorf("deleting S3 Bucket (%s) objects: %w", os.bucket, err)
}
Expand Down

0 comments on commit dbdbd12

Please sign in to comment.