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

Add support for custom roundtripper #140

Merged
merged 9 commits into from
Oct 3, 2024

Conversation

milinddethe15
Copy link
Contributor

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Added a parameter in NewBucket() to pass custom roundtripper

Verification

Created tests in which a always error returning roundtripper is passed to NewBucket() and tested whether error is caught or not.

milinddethe15 and others added 4 commits September 13, 2024 21:42
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
Signed-off-by: Milind Dethe <99114125+milinddethe15@users.noreply.github.com>
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
milinddethe15 and others added 4 commits October 1, 2024 11:22
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
@milinddethe15 milinddethe15 marked this pull request as ready for review October 2, 2024 10:12
Copy link
Member

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

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

Generally LGTM!
Just some minor nits

@@ -20,7 +23,7 @@ type TestCase struct {
}

var validConfig = []byte(`storage_account: "myStorageAccount"
storage_account_key: "abc123"
storage_account_key: "bXlTdXBlclNlY3JldEtleTEyMyFAIw=="
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be base64 encoded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, otherwise it would give error.

providers/bos/bos.go Outdated Show resolved Hide resolved
providers/oss/oss_test.go Outdated Show resolved Hide resolved
providers/oci/oci_test.go Outdated Show resolved Hide resolved
providers/oci/oci_test.go Outdated Show resolved Hide resolved
providers/oss/oss.go Outdated Show resolved Hide resolved
providers/oss/oss_test.go Outdated Show resolved Hide resolved
providers/obs/obs.go Outdated Show resolved Hide resolved
providers/gcs/gcs_test.go Outdated Show resolved Hide resolved
providers/azure/helpers.go Outdated Show resolved Hide resolved
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
@GiedriusS GiedriusS merged commit 8897e65 into thanos-io:main Oct 3, 2024
7 checks passed
@@ -201,7 +201,7 @@ func (s *overrideSignerType) Retrieve() (credentials.Value, error) {
}

// NewBucketWithConfig returns a new Bucket using the provided s3 config values.
func NewBucketWithConfig(logger log.Logger, config Config, component string) (*Bucket, error) {
func NewBucketWithConfig(logger log.Logger, config Config, component string, rt http.RoundTripper) (*Bucket, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I might be too late to this. But if we already have config.HTTPConfig.Transport, why do we still introduce a new rt parameter?

Copy link
Member

Choose a reason for hiding this comment

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

We changed this in a follow up PR

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.

4 participants