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

Added bucket-lookup-type field to s3 config #3788

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devmentality
Copy link

Hi Pyroscope Team!
This pull request targets the issue.
There are a few details I would like to point out:

  • We have discussed previously that it would be great to show a warning if force-path is set to true, that this flag is deprecated and might be removed going forward. Unfortunately, I haven't found an elegant solution to do that and just put a deprecation message to flag's usage. There are flagext package, but it is used to replace deprecated flag completely. Pflag library has deprecation feature, but you use plain flag library here.
  • It seems that s3 config is not validated with the application start. I may fix that in this PR, if you wish. But it may require thorough testing to ensure that validation won't break anything.

@devmentality devmentality requested a review from a team as a code owner December 17, 2024 14:08
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

Thank you for working on this ❤️

@@ -108,6 +121,14 @@ func (cfg *Config) Validate() error {
return errUnsupportedSignatureVersion
}

if cfg.ForcePathStyle && cfg.BucketLookupType == VirtualHostedStyleLookup {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Might be slightly more failsafe, once there is another lookup type added (I hope not 😆 )

Suggested change
if cfg.ForcePathStyle && cfg.BucketLookupType == VirtualHostedStyleLookup {
if cfg.ForcePathStyle && cfg.BucketLookupType != AutoLookup && cfg.BucketLookupType != PathStyleLookup {

@@ -39,8 +39,10 @@ func newS3Config(cfg Config) (s3.Config, error) {
}

bucketLookupType := s3.AutoLookup
if cfg.ForcePathStyle {
if cfg.ForcePathStyle || cfg.BucketLookupType == PathStyleLookup {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we also should add a deprecation log warning when ForcePath argument is used, so users can notice it and migrate to BucketLookupType

Wdyt?

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.

3 participants