drone-plugins / drone-s3-cache

Caches build artifacts to S3 compatible storage backends
http://plugins.drone.io/drone-plugins/drone-s3-cache
Apache License 2.0
29 stars 30 forks source link

Flush action doesn't use proper region while using S3 #57

Open Upgreydd opened 4 years ago

Upgreydd commented 4 years ago

Finally configured s3 cache, but endpoint: https://my-bucket-drone.s3.ap-south-1.amazonaws.com which is in ap-south-1 with flush returns:

The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-south-1' 

rebuild and restore works fine ;)

donny-dont commented 4 years ago

Ok cool so it looks like I would need to parse urls of the scheme

https://bucket-name.s3.Region.amazonaws.com/key name

And this scheme

https://s3.Region.amazonaws.com/bucket-name/key name

And I could take s3 urls but those would need to provide the region

S3://bucket-name/key-name

From https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html

Upgreydd commented 4 years ago

@donny-dont There's a region in env vars so probably S3://bucket-url will be more AWS way. BTW. Probably you're parsing in rebuild and restore actions cause they works fine, only flush failures.

donny-dont commented 3 years ago

@Upgreydd #59 I think might get your issues solved. If you can build it locally and try it against things that'd be super helpful.