nastra commented on code in PR #118:
URL: https://github.com/apache/iceberg-go/pull/118#discussion_r1719559818
##########
io/s3.go:
##########
@@ -45,43 +44,42 @@ const (
)
func createS3FileIO(parsed *url.URL, props map[string]string) (IO, error) {
- opts := []func(*config.LoadOptions) error{}
+ cfgOpts := []func(*config.LoadOptions) error{}
+ opts := []func(*s3.Options){}
+
endpoint, ok := props[S3EndpointURL]
if !ok {
endpoint = os.Getenv("AWS_S3_ENDPOINT")
}
if endpoint != "" {
- opts = append(opts,
config.WithEndpointResolverWithOptions(aws.EndpointResolverWithOptionsFunc(func(service,
region string, options ...interface{}) (aws.Endpoint, error) {
- if service != s3.ServiceID {
- // fallback to default resolution for the
service
- return aws.Endpoint{},
&aws.EndpointNotFoundError{}
- }
-
- return aws.Endpoint{
- URL: endpoint,
- SigningRegion: region,
- HostnameImmutable: true,
- }, nil
- })))
+ opts = append(opts, func(o *s3.Options) {
Review Comment:
for the future I think it would be great to just extract such things out
into a separate (small) PR. That way we can get PRs reviewed faster as
otherwise it's quite difficult to find long periods of time to review a huge
chunk of new code that is mixed with other changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]