Skip to content

Commit

Permalink
Merge pull request kubernetes#16657 from justinsb/export_s3_bucket_re…
Browse files Browse the repository at this point in the history
…gion

refactor: allow access to S3 bucket region
  • Loading branch information
k8s-ci-robot authored Jul 4, 2024
2 parents a4c9151 + a337ca9 commit aac8226
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions util/pkg/vfs/s3fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ func newS3Path(s3Context *S3Context, scheme string, bucket string, key string, s
}
}

func (p *S3Path) Region(ctx context.Context) (string, error) {
bucketDetails, err := p.getBucketDetails(ctx)
if err != nil {
return "", err
}

return bucketDetails.region, nil
}

func (p *S3Path) Path() string {
return p.scheme + "://" + p.bucket + "/" + p.key
}
Expand Down

0 comments on commit aac8226

Please sign in to comment.