Skip to content

Commit

Permalink
Const
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Oct 29, 2024
1 parent 77fdff4 commit b7a9747
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/service/s3/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func RegisterSweepers() {
)
}

const logKeyBucketName = "bucket_name"

func sweepObjects(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepable, error) {
tflog.Info(ctx, "Noop sweeper")
return nil, nil
Expand All @@ -65,7 +67,7 @@ func sweepGeneralPurposeBucketObjects(ctx context.Context, client *conns.AWSClie

for _, bucket := range page.Buckets {
bucketName := aws.ToString(bucket.Name)
ctx = tflog.SetField(ctx, "bucket_name", bucketName)
ctx = tflog.SetField(ctx, logKeyBucketName, bucketName)
if !bucketNameFilter(ctx, bucket) {
continue
}
Expand Down Expand Up @@ -107,7 +109,7 @@ func sweepDirectoryBucketObjects(ctx context.Context, client *conns.AWSClient) (

for _, bucket := range page.Buckets {
bucketName := aws.ToString(bucket.Name)
ctx = tflog.SetField(ctx, "bucket_name", bucketName)
ctx = tflog.SetField(ctx, logKeyBucketName, bucketName)
if !bucketNameFilter(ctx, bucket) {
continue
}
Expand Down Expand Up @@ -175,7 +177,7 @@ func sweepBuckets(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepab
}

for _, bucket := range page.Buckets {
ctx = tflog.SetField(ctx, "bucket_name", aws.ToString(bucket.Name))
ctx = tflog.SetField(ctx, logKeyBucketName, aws.ToString(bucket.Name))
if !bucketNameFilter(ctx, bucket) {
continue
}
Expand Down Expand Up @@ -232,7 +234,7 @@ func sweepDirectoryBuckets(ctx context.Context, client *conns.AWSClient) ([]swee
}

for _, bucket := range page.Buckets {
ctx = tflog.SetField(ctx, "bucket_name", aws.ToString(bucket.Name))
ctx = tflog.SetField(ctx, logKeyBucketName, aws.ToString(bucket.Name))
if !bucketNameFilter(ctx, bucket) {
continue
}
Expand Down

0 comments on commit b7a9747

Please sign in to comment.