From a019b0af0744c48a16306fdc747c8c5b7b0e9852 Mon Sep 17 00:00:00 2001 From: jfwarner Date: Wed, 8 Jun 2016 14:03:19 -0400 Subject: [PATCH] restoring default credentials object to "a chain of credential providers to search for credentials in environment variables, shared credential file, and EC2 Instance Roles" --- main.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 5a9858eb..9ef41ec6 100644 --- a/main.go +++ b/main.go @@ -73,17 +73,16 @@ func mount( mountPoint string, flags *FlagStorage) (mfs *fuse.MountedFileSystem, err error) { - var creds *credentials.Credentials - if len(flags.Profile) > 0 { - creds = credentials.NewSharedCredentials(os.Getenv("HOME")+"/.aws/credentials", flags.Profile) - } - awsConfig := &aws.Config{ Region: &flags.Region, Logger: GetLogger("s3"), - Credentials: creds, //LogLevel: aws.LogLevel(aws.LogDebug), } + + if len(flags.Profile) > 0 { + awsConfig.Credentials = credentials.NewSharedCredentials(os.Getenv("HOME")+"/.aws/credentials", flags.Profile) + } + if len(flags.Endpoint) > 0 { awsConfig.Endpoint = &flags.Endpoint }