kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

S3 context implementation has issues with non default regions and shared credentials

Open daniel-harrison opened this issue 8 years ago • 3 comments

Hi, I was attempting to use the s3 context and ran into some issues using ap-southeast-2 and creating a k8s job with mounted credentials .aws/config and .asw/credentials. Errors reported around authentication and region permissions otherwise.

I think this line in s3.go

downloader := s3manager.NewDownloader(session.New())

Should be something like

// enable shared config
sess, err := session.NewSessionWithOptions(session.Options{
	SharedConfigState: session.SharedConfigEnable,
})
if err != nil {
	return s.context, err
}
downloader := s3manager.NewDownloader(sess)

That at least worked for me, but interested if anyone else has had issues.

daniel-harrison avatar Aug 13 '18 02:08 daniel-harrison

Hey @daniel-harrison , thanks for pointing this bug out. Would you be interested in opening a PR with these changes?

priyawadhwa avatar Aug 13 '18 18:08 priyawadhwa

Yep no worries, not a go guy so let me know if it's not good practice.

daniel-harrison avatar Aug 13 '18 22:08 daniel-harrison

Closing as this should be fixed in #321

priyawadhwa avatar Aug 27 '18 23:08 priyawadhwa