Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix create-bucket: exclude LocationConstraint for us-east-1 #6836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

steffyP
Copy link
Member

@steffyP steffyP commented Sep 7, 2022

This is a preparation for ASF S3 migration. The old provider, filters LocationConstraint for create-bucket:

 # TODO: For some reason, moto doesn't allow us to put a location constraint on us-east-1
        to_find1 = to_bytes("<LocationConstraint>us-east-1</LocationConstraint>")
        to_find2 = to_bytes("<CreateBucketConfiguration")
        if data and data.startswith(to_bytes("<")) and to_find1 in data and to_find2 in data:
            # Note: with the latest version, <CreateBucketConfiguration> must either
            # contain a valid <LocationConstraint>, or not be present at all in the body.
            modified_data = b""

With the new ASF S3 provider, we will have the same behavior as AWS:
LocationConstraint for bucket creation should only be included if the location is not the default location (e.g. not us-east-1). Otherwise it will thrown an IllegalLocationConstraintException.

According to the API, us-east-1 is not a valid identifier for LocationConstraint

There was previously a check, but it was removed with PR #6171.

@steffyP steffyP temporarily deployed to localstack-ext-tests September 7, 2022 11:08 Inactive
@steffyP steffyP force-pushed the fix_cloudformation_s3 branch from 7febd87 to c40e3c5 Compare September 7, 2022 12:25
@github-actions
Copy link

github-actions bot commented Sep 7, 2022

LocalStack integration with Pro

       3 files         3 suites   1h 22m 51s ⏱️
1 274 tests 1 223 ✔️ 51 💤 0
1 699 runs  1 617 ✔️ 82 💤 0

Results for commit c40e3c5.

♻️ This comment has been updated with latest results.

@steffyP steffyP temporarily deployed to localstack-ext-tests September 7, 2022 12:25 Inactive
@steffyP steffyP marked this pull request as ready for review September 8, 2022 08:04
@steffyP steffyP requested a review from thrau as a code owner September 8, 2022 08:04
Copy link
Member

@dominikschubert dominikschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@steffyP steffyP merged commit c155d00 into master Sep 9, 2022
@steffyP steffyP deleted the fix_cloudformation_s3 branch September 9, 2022 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants