cycloidio / raws

[UNMAINTAINED] AWS Reader
MIT License
15 stars 0 forks source link

s3: update region logic for ListBuckets method #51

Closed xlr-8 closed 5 years ago

xlr-8 commented 5 years ago

The previous implementation was relying on 'GetBucketLocation' however this seems flawed as the pointer could be nil (trigger panics), and the returned result would not fully match the existing regions; as the result of location are following: https://github.com/aws/aws-sdk-go/blob/master/service/s3/api.go#L24385

So this would have worked only for a handful of cases. Using GetBucketRegionWithClient should solve that, however it is not scoped to any interface/struct, so it makes the testing more painful.

Closes: https://github.com/cycloidio/raws/issues/50

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 66.124% when pulling 1bf35da314006b8eee59ac9a3c6e67d3fbefe370 on hr-50 into f0c460953ee7206dcdb54242c451fb25c987026c on master.