Add relative URI for AWS fargate. (#1337)

* f

* r

* f

* gofmt

* ep

* Container url

* Asd

* nit

* Update docs

* keep old stuff

* old is gold

* indent

* asd
This commit is contained in:
Manu Gupta
2019-08-21 06:21:01 -07:00
committed by Aaron Schlesinger
parent 6a42417d5b
commit 16739a1213
4 changed files with 63 additions and 20 deletions
+5 -1
View File
@@ -44,7 +44,7 @@ func New(s3Conf *config.S3Config, timeout time.Duration, options ...func(*aws.Co
if !s3Conf.UseDefaultConfiguration {
endpointcreds := []credentials.Provider{
endpointcreds.NewProviderClient(*awsConfig, defaults.Handlers(), s3Conf.CredentialsEndpoint),
endpointcreds.NewProviderClient(*awsConfig, defaults.Handlers(), endpointFrom(s3Conf.CredentialsEndpoint, s3Conf.AwsContainerCredentialsRelativeURI)),
&credentials.StaticProvider{
Value: credentials.Value{
AccessKeyID: s3Conf.Key,
@@ -75,3 +75,7 @@ func New(s3Conf *config.S3Config, timeout time.Duration, options ...func(*aws.Co
timeout: timeout,
}, nil
}
func endpointFrom(credentialsEndpoint string, relativeURI string) string {
return credentialsEndpoint + relativeURI
}