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

Set S3AsyncClient endpoint from localstack if available in tests #1330

Merged
merged 2 commits into from
Feb 1, 2025

Conversation

ofir-popowski
Copy link
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Changing S3CrtAsyncClientAutoConfiguration#s3AsyncClient to call AwsConnectionDetails#getEndpoint if available that should provide the S3AsyncClient with the endpoint to the localstack container if available.
I'm not sure if this was the right way to achieve this, hence a draft PR

💡 Motivation and Context

Fixes #1329. It looks like the S3AsyncClient wasn't fetching the endpoint from localstack container

💚 How did you test it?

Added a test method AwsContainerConnectionDetailsFactoryTest#configuresS3AsyncClientWithServiceConnection that checks @Autowired S3AsyncClient client can list buckets while relying in @ServiceConnection localstack container

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated reference documentation to reflect the change
  • All tests passing
  • No breaking changes

🔮 Next steps

None?

@ofir-popowski
Copy link
Contributor Author

I initially opened this PR as draft because I was unsure about the way I approached this fix and the implementation, but I couldn't find any other way to do that same thing
Would love some input on that

@maciejwalkowiak maciejwalkowiak added the type: bug Something isn't working label Feb 1, 2025
@maciejwalkowiak
Copy link
Contributor

Thanks a lot @ofir-popowski !

@maciejwalkowiak maciejwalkowiak merged commit eb1f7a6 into awspring:main Feb 1, 2025
4 checks passed
@maciejwalkowiak maciejwalkowiak added this to the 3.3.1 milestone Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: s3 S3 integration related issue type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

S3AsyncClient with localstack in test fails to perform S3 operations, uses wrong endpoint
2 participants