-
Notifications
You must be signed in to change notification settings - Fork 100
Hedged-request: Handling in HTTP Client Configuration #119
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
3ca3d25
e606f9d
659a3bc
1cffe47
540c1e5
1b2aa76
bd0b7b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ package client | |
| import ( | ||
| "context" | ||
| "fmt" | ||
| "net/http" | ||
| "strings" | ||
|
|
||
| "github.com/thanos-io/objstore" | ||
|
|
@@ -49,7 +50,7 @@ type BucketConfig struct { | |
|
|
||
| // NewBucket initializes and returns new object storage clients. | ||
| // NOTE: confContentYaml can contain secrets. | ||
| func NewBucket(logger log.Logger, confContentYaml []byte, component string) (objstore.Bucket, error) { | ||
| func NewBucket(logger log.Logger, confContentYaml []byte, component string, rt http.RoundTripper) (objstore.Bucket, error) { | ||
| level.Info(logger).Log("msg", "loading bucket configuration") | ||
| bucketConf := &BucketConfig{} | ||
| if err := yaml.UnmarshalStrict(confContentYaml, bucketConf); err != nil { | ||
|
|
@@ -64,23 +65,23 @@ func NewBucket(logger log.Logger, confContentYaml []byte, component string) (obj | |
| var bucket objstore.Bucket | ||
| switch strings.ToUpper(string(bucketConf.Type)) { | ||
| case string(GCS): | ||
| bucket, err = gcs.NewBucket(context.Background(), logger, config, component) | ||
| bucket, err = gcs.NewBucket(context.Background(), logger, config, component, rt) | ||
| case string(S3): | ||
| bucket, err = s3.NewBucket(logger, config, component) | ||
| bucket, err = s3.NewBucket(logger, config, component, rt) | ||
| case string(AZURE): | ||
| bucket, err = azure.NewBucket(logger, config, component) | ||
| bucket, err = azure.NewBucket(logger, config, component, rt) | ||
| case string(SWIFT): | ||
| bucket, err = swift.NewContainer(logger, config) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not supported by all providers? 🤔 I checked a few like swift/bos and I don't see a reason why this is not implemented there.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
i added this parameter to the providers which had http.Client , swift does not uses NewBucket but bos/obs can have this parameter i think also i see that obs makes new ObsClient and bos uses NewClient which makes a BOS client...wdyt? |
||
| case string(COS): | ||
| bucket, err = cos.NewBucket(logger, config, component) | ||
| bucket, err = cos.NewBucket(logger, config, component, rt) | ||
| case string(ALIYUNOSS): | ||
| bucket, err = oss.NewBucket(logger, config, component) | ||
| case string(FILESYSTEM): | ||
| bucket, err = filesystem.NewBucketFromConfig(config) | ||
| case string(BOS): | ||
| bucket, err = bos.NewBucket(logger, config, component) | ||
| case string(OCI): | ||
| bucket, err = oci.NewBucket(logger, config) | ||
| bucket, err = oci.NewBucket(logger, config, rt) | ||
| case string(OBS): | ||
| bucket, err = obs.NewBucket(logger, config) | ||
| default: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.