Skip to content

Commit aac8226

Browse files
authored
Merge pull request #16657 from justinsb/export_s3_bucket_region
refactor: allow access to S3 bucket region
2 parents a4c9151 + a337ca9 commit aac8226

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

util/pkg/vfs/s3fs.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ func newS3Path(s3Context *S3Context, scheme string, bucket string, key string, s
7777
}
7878
}
7979

80+
func (p *S3Path) Region(ctx context.Context) (string, error) {
81+
bucketDetails, err := p.getBucketDetails(ctx)
82+
if err != nil {
83+
return "", err
84+
}
85+
86+
return bucketDetails.region, nil
87+
}
88+
8089
func (p *S3Path) Path() string {
8190
return p.scheme + "://" + p.bucket + "/" + p.key
8291
}

0 commit comments

Comments
 (0)