Repository navigation
Added support to specifiy custom endpoint - #1512
Conversation
Current coverage is
|
|
cc @BrianBland |
| return nil, fmt.Errorf("Invalid region provided: %v", region) | ||
| } | ||
|
|
||
| regionEndpoint, ok := parameters["regionendpoint"] |
There was a problem hiding this comment.
Should only one of region and regionendpoint be provided? If so, you should change the check for the region parameter above as well as the documentation to reflect this.
There was a problem hiding this comment.
i want both region and region endpoint to be provided because it is required during creation of s3 client object.
There was a problem hiding this comment.
Is the region value actually used for non-S3 endpoints? It doesn't seem to be the case for Minio
There was a problem hiding this comment.
yes Minio requires it to be 'us-east-1'
|
@BrianBland i had made the changes mentioned. |
|
@kmala I think the reason for doing this is to minimize the required permissions for running the S3 driver, as listing buckets/creating buckets requires permissions other than operations within a specific bucket in S3. I'm personally not opposed to adding this behavior, but we should either document the permissions required or ignore errors. |
|
@BrianBland Can you review it again and see if something needs to be done |
|
|
||
| `region`: The name of the aws region in which you would like to store objects (for example `us-east-1`). For a list of regions, you can look at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html | ||
|
|
||
| `regionendpoint`: empty for Amazon S3 or url for S3 compatible APIs. |
There was a problem hiding this comment.
`regionendpoint`: (optional) Endpoint URL for S3 compatible APIs. This should not be provided when using Amazon S3.
|
@BrianBland added your review comments |
| return nil, fmt.Errorf("No bucket parameter provided") | ||
| } | ||
|
|
||
| regionEndpoint, ok := parameters["regionendpoint"] |
There was a problem hiding this comment.
Sorry I actually just noticed this, but this should follow the pattern of nil checking like the other parameters, otherwise it's possible for fmt.Sprint(regionEndpoint) to return "<nil>". Other than that this looks good to me
Signed-off-by: Keerthan Reddy Mala <[email protected]>
|
LGTM, thanks for the quick updates |
|
@BrianBland can this be merged |
|
LGTM |
Added support to specifiy custom endpoint
Added support to specifiy custom endpoint
Added support to specifiy custom endpoint
Main purpose of this PR is to enhance the support to provide custom endpoint url which can be used to connect to other S3 compatibly storage services like Minio.
I also want to know if there is any reason preventing from adding the extra condition to create a bucket if it doesn't exist similar to https://github.com/docker/distribution/blob/master/registry/storage/driver/azure/azure.go#L87