From 587a5e28e39168d1063954a6f553dc02344a6beb Mon Sep 17 00:00:00 2001 From: daniel-harrison Date: Thu, 23 Aug 2018 20:53:43 +1000 Subject: [PATCH] Enable shared config for s3 --- pkg/buildcontext/s3.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/buildcontext/s3.go b/pkg/buildcontext/s3.go index e752dec534..af2aa503b3 100644 --- a/pkg/buildcontext/s3.go +++ b/pkg/buildcontext/s3.go @@ -35,7 +35,13 @@ type S3 struct { // UnpackTarFromBuildContext download and untar a file from s3 func (s *S3) UnpackTarFromBuildContext() (string, error) { bucket, item := util.GetBucketAndItem(s.context) - downloader := s3manager.NewDownloader(session.New()) + sess, err := session.NewSessionWithOptions(session.Options{ + SharedConfigState: session.SharedConfigEnable, + }) + if err != nil { + return bucket, err + } + downloader := s3manager.NewDownloader(sess) directory := constants.BuildContextDir tarPath := filepath.Join(directory, constants.ContextTar) if err := os.MkdirAll(directory, 0750); err != nil {