-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(aws_s3 sink): add option to use virtual addressing #21999
Conversation
207f753
to
30feaa4
Compare
30feaa4
to
5ebb457
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution @sam6258 !
Do you think it'd be possible to add an integration test that uses the virtual addressing style? It looks like localstack supports it.
Integration tests are defined here: https://github.com/vectordotdev/vector/blob/master/src/sinks/aws_s3/integration_tests.rs |
@jszwedko working on this! My editor didn't let me know I broke integration tests in the call to |
I enabled the CI checks (because it requires approval by maintainers). Local iterations should be much faster. This might be helpful: https://github.com/vectordotdev/vector/blob/master/scripts/integration/README.md |
Adapted the integration tests for the new function call structure and added |
3e95f13
to
a6a184e
Compare
Signed-off-by: Scott Miller <[email protected]>
a6a184e
to
d03f11b
Compare
@pront I fixed the CI check that was failing if you can kick off again, thanks! |
Is PR now ready for a final review? There has been difficulty with getting an IT running? |
Yes, PR in my opinion is ready for final review. It passes existing tests, but I wasn't able to get a test to cover the new functionality per this comment. #21999 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sam6258
Is there anything else we need to do to get this merged? |
Leaving it this up to @jszwedko, due to this thread: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sam6258 ! I see that it'd be difficult to add an integration test due to the necessity of docker-compose supporting wildcard domains. In this case, I think we can just rely on the SDK to do the right thing.
I left one comment about changing the way the configuration is injected, but otherwise I think this looks good to go.
Signed-off-by: Scott Miller <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sam6258 ! This looks much better. Just one last minor comment. Otherwise I think this is good to go.
src/common/s3.rs
Outdated
if let Some(true) = self.force_path_style { | ||
builder = builder.force_path_style(true); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could avoid the if let Some
if you just do: builder = builder.set_force_path_style(self.force_path_style)
. The set_*
variants on the AWS SDK take Option
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I opted to use force_path_style
still so I could unwrap to true
by default in case someone forgets to set the value in S3ClientBuilder
. That way it maintains vector's previous behavior even in a programming error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @sam6258 !
Summary
The following PR adds an option to enable virtual host style addressing to an s3 sink. The
force_path_style
option defaults totrue
for backwards compatibility and may eventually be desired to default tofalse
as path style addressing will eventually be removed from aws s3.This is my first Rust and first Vector PR, so please correct me on any contribution guidelines, style semantics, and code patterns!
Change Type
Is this a breaking change?
How did you test this PR?
I pointed an aws s3 sink at my object storage service and validated both path style and vhost style addressing works and also has the correct
authority
in access logs.Does this PR include user facing changes?
Checklist
Cargo.lock
), pleaserun
dd-rust-license-tool write
to regenerate the license inventory and commit the changes (if any). More details here.References