mirror of
https://github.com/distribution/distribution.git
synced 2025-09-03 16:05:51 +00:00
Allow setting s3 forcepathstyle without regionendpoint
Currently, the `forcepathstyle` parameter for the s3 storage driver is considered only if the `regionendpoint` parameter is set. Since setting a region endpoint explicitly is discouraged with AWS s3, it is not clear how to enforce path style URLs with AWS s3. This also means, that the default value (true) only applies if a region endpoint is configured. This change makes sure we always forward the `forcepathstyle` parameter to the aws-sdk if present in the config. This is a breaking change where a `regionendpoint` is configured but no explicit `forcepathstyle` value is set. Signed-off-by: Benjamin Schanzel <benjamin.schanzel@bmw.de>
This commit is contained in:
@@ -205,7 +205,7 @@ func FromParameters(ctx context.Context, parameters map[string]interface{}) (*Dr
|
||||
regionEndpoint = ""
|
||||
}
|
||||
|
||||
forcePathStyleBool := true
|
||||
forcePathStyleBool := false
|
||||
forcePathStyle := parameters["forcepathstyle"]
|
||||
switch forcePathStyle := forcePathStyle.(type) {
|
||||
case string:
|
||||
@@ -529,9 +529,9 @@ func New(ctx context.Context, params DriverParameters) (*Driver, error) {
|
||||
|
||||
if params.RegionEndpoint != "" {
|
||||
awsConfig.WithEndpoint(params.RegionEndpoint)
|
||||
awsConfig.WithS3ForcePathStyle(params.ForcePathStyle)
|
||||
}
|
||||
|
||||
awsConfig.WithS3ForcePathStyle(params.ForcePathStyle)
|
||||
awsConfig.WithS3UseAccelerate(params.Accelerate)
|
||||
awsConfig.WithRegion(params.Region)
|
||||
awsConfig.WithDisableSSL(!params.Secure)
|
||||
|
Reference in New Issue
Block a user