Skip to content

Commit 93f7910

Browse files
author
Matthew Fisher
authored
Merge pull request #82 from aboyett/fix-s3-us-east-1
fix(create_bucket): avoid S3 InvalidLocationConstraint error
2 parents 1ef4525 + a885078 commit 93f7910

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

rootfs/bin/create-bucket

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ if os.getenv('REGISTRY_STORAGE') == "s3" and os.getenv('REGISTRY_STORAGE_S3_BACK
2525
conn = boto.s3.connect_to_region(region)
2626

2727
if not bucket_exists(conn, bucket_name):
28-
conn.create_bucket(bucket_name, location=region)
28+
if region == "us-east-1":
29+
# use "US Standard" region. workaround for https://github.com/boto/boto3/issues/125
30+
conn.create_bucket(bucket_name)
31+
else:
32+
conn.create_bucket(bucket_name, location=region)
2933

3034
elif os.getenv('REGISTRY_STORAGE') == "gcs":
3135
scopes = ['https://www.googleapis.com/auth/devstorage.full_control']

0 commit comments

Comments
 (0)