Skip to content
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

refactor: retry readiness check S3 bucket creation with default config #146

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,16 @@ def is_enabled(self) -> bool:
return is_enabled

def _setup_bucket(self):
self.log.info(f'setting up test s3 bucket ({self.test_bucket_name})')
self.s3.create_bucket(Bucket=self.test_bucket_name, CreateBucketConfiguration={
'LocationConstraint': self.test_bucket_region})
self.log.info(f'setting up test s3 bucket ({self.test_bucket_name}) with LocationConstraint ({self.test_bucket_region})')
try:
self.s3.create_bucket(Bucket=self.test_bucket_name, CreateBucketConfiguration={
'LocationConstraint': self.test_bucket_region})
self.log.info(f'test s3 bucket ({self.test_bucket_name}) created')
except Exception as e:
self.log.info(f'failed to create test s3 bucket ({self.test_bucket_name}) with LocationConstraint ({self.test_bucket_region}) - exception: {e} - retrying without LocationConstraint, please request access to S3Select')
self.s3.create_bucket(Bucket=self.test_bucket_name)
self.log.info(f'test s3 bucket ({self.test_bucket_name}) created without LocationConstraint')


def _cleanup_bucket(self):
self.log.info(f'cleaning up test s3 bucket ({self.test_bucket_name})')
Expand Down