From ab05957dd29d67612e393e249fbcb75c02a86e55 Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Fri, 24 Jun 2022 23:15:09 +0530 Subject: [PATCH 01/18] Refactoring the DefaultTransport func in package exthttp Signed-off-by: Srushti Sapkale --- pkg/exthttp/transport.go | 62 ++++++++++++++++++++++ pkg/objstore/azure/azure_test.go | 3 +- pkg/objstore/azure/helpers.go | 38 ++----------- pkg/objstore/cos/cos.go | 2 +- pkg/objstore/s3/s3.go | 91 ++++++-------------------------- pkg/objstore/s3/s3_test.go | 3 +- test/e2e/e2ethanos/services.go | 4 +- 7 files changed, 91 insertions(+), 112 deletions(-) diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index 60e82e2cc8..be58d3e7af 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -7,8 +7,28 @@ import ( "net" "net/http" "time" + + "github.com/prometheus/common/model" + "github.com/thanos-io/thanos/pkg/objstore" ) +type HTTPConfig struct { + IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` + ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` + InsecureSkipVerify bool `yaml:"insecure_skip_verify"` + + TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` + ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` + MaxIdleConns int `yaml:"max_idle_conns"` + MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` + MaxConnsPerHost int `yaml:"max_conns_per_host"` + + // Allow upstream callers to inject a round tripper + Transport http.RoundTripper `yaml:"-"` + + TLSConfig objstore.TLSConfig `yaml:"tls_config"` +} + // NewTransport creates a new http.Transport with default settings. func NewTransport() *http.Transport { return &http.Transport{ @@ -25,3 +45,45 @@ func NewTransport() *http.Transport { ExpectContinueTimeout: 1 * time.Second, } } + +// DefaultTransport - this default transport is based on the Minio +// DefaultTransport up until the following commit: +// https://github.com/minio/minio-go/commit/008c7aa71fc17e11bf980c209a4f8c4d687fc884 +// The values have since diverged. +func DefaultTransport(config HTTPConfig) (*http.Transport, error) { + tlsConfig, err := objstore.NewTLSConfig(&config.TLSConfig) + if err != nil { + return nil, err + } + + if config.InsecureSkipVerify { + tlsConfig.InsecureSkipVerify = true + } + + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + + MaxIdleConns: config.MaxIdleConns, + MaxIdleConnsPerHost: config.MaxIdleConnsPerHost, + IdleConnTimeout: time.Duration(config.IdleConnTimeout), + MaxConnsPerHost: config.MaxConnsPerHost, + TLSHandshakeTimeout: time.Duration(config.TLSHandshakeTimeout), + ExpectContinueTimeout: time.Duration(config.ExpectContinueTimeout), + // A custom ResponseHeaderTimeout was introduced + // to cover cases where the tcp connection works but + // the server never answers. Defaults to 2 minutes. + ResponseHeaderTimeout: time.Duration(config.ResponseHeaderTimeout), + // Set this value so that the underlying transport round-tripper + // doesn't try to auto decode the body of objects with + // content-encoding set to `gzip`. + // + // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. + DisableCompression: true, + TLSClientConfig: tlsConfig, + }, nil +} diff --git a/pkg/objstore/azure/azure_test.go b/pkg/objstore/azure/azure_test.go index ffef1c8a0e..21d16f8cd3 100644 --- a/pkg/objstore/azure/azure_test.go +++ b/pkg/objstore/azure/azure_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -235,7 +236,7 @@ http_config: `) cfg, err := parseConfig(input) testutil.Ok(t, err) - transport, err := DefaultTransport(cfg) + transport, err := exthttp.DefaultTransport(cfg) testutil.Ok(t, err) testutil.Equals(t, true, transport.TLSClientConfig.InsecureSkipVerify) } diff --git a/pkg/objstore/azure/helpers.go b/pkg/objstore/azure/helpers.go index 3a2e31954f..e044159504 100644 --- a/pkg/objstore/azure/helpers.go +++ b/pkg/objstore/azure/helpers.go @@ -6,7 +6,8 @@ package azure import ( "context" "fmt" - "net" + + //"net" "net/http" "net/url" "regexp" @@ -18,7 +19,8 @@ import ( "github.com/Azure/go-autorest/autorest/azure/auth" "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/thanos-io/thanos/pkg/objstore" + "github.com/thanos-io/thanos/pkg/exthttp" + //"github.com/thanos-io/thanos/pkg/objstore" ) // DirDelim is the delimiter used to model a directory structure in an object store bucket. @@ -104,7 +106,7 @@ func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob. retryOptions.TryTimeout = time.Until(deadline) } - dt, err := DefaultTransport(conf) + dt, err := exthttp.DefaultTransport(conf.HTTPConfig) if err != nil { return blob.ContainerURL{}, err } @@ -140,36 +142,6 @@ func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob. return service.NewContainerURL(conf.ContainerName), nil } -func DefaultTransport(config Config) (*http.Transport, error) { - tlsConfig, err := objstore.NewTLSConfig(&config.HTTPConfig.TLSConfig) - if err != nil { - return nil, err - } - - if config.HTTPConfig.InsecureSkipVerify { - tlsConfig.InsecureSkipVerify = true - } - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - - MaxIdleConns: config.HTTPConfig.MaxIdleConns, - MaxIdleConnsPerHost: config.HTTPConfig.MaxIdleConnsPerHost, - IdleConnTimeout: time.Duration(config.HTTPConfig.IdleConnTimeout), - MaxConnsPerHost: config.HTTPConfig.MaxConnsPerHost, - TLSHandshakeTimeout: time.Duration(config.HTTPConfig.TLSHandshakeTimeout), - ExpectContinueTimeout: time.Duration(config.HTTPConfig.ExpectContinueTimeout), - - ResponseHeaderTimeout: time.Duration(config.HTTPConfig.ResponseHeaderTimeout), - DisableCompression: config.HTTPConfig.DisableCompression, - TLSClientConfig: tlsConfig, - }, nil -} - func getContainer(ctx context.Context, logger log.Logger, conf Config) (blob.ContainerURL, error) { c, err := getContainerURL(ctx, logger, conf) if err != nil { diff --git a/pkg/objstore/cos/cos.go b/pkg/objstore/cos/cos.go index 91529db2a5..3e1e9e2e46 100644 --- a/pkg/objstore/cos/cos.go +++ b/pkg/objstore/cos/cos.go @@ -105,7 +105,6 @@ type HTTPConfig struct { MaxConnsPerHost int `yaml:"max_conns_per_host"` } -// DefaultTransport build http.Transport from config. func DefaultTransport(c HTTPConfig) *http.Transport { transport := exthttp.NewTransport() transport.IdleConnTimeout = time.Duration(c.IdleConnTimeout) @@ -149,6 +148,7 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B bucketURL = cos.NewBucketURL(fmt.Sprintf("%s-%s", config.Bucket, config.AppId), config.Region, true) } b := &cos.BaseURL{BucketURL: bucketURL} + client := cos.NewClient(b, &http.Client{ Transport: &cos.AuthorizationTransport{ SecretID: config.SecretId, diff --git a/pkg/objstore/s3/s3.go b/pkg/objstore/s3/s3.go index 1ece1a51f8..50bad1dc34 100644 --- a/pkg/objstore/s3/s3.go +++ b/pkg/objstore/s3/s3.go @@ -9,7 +9,6 @@ import ( "fmt" "io" "io/ioutil" - "net" "net/http" "os" "runtime" @@ -28,7 +27,9 @@ import ( "github.com/prometheus/common/version" "gopkg.in/yaml.v2" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/objstore" + "github.com/thanos-io/thanos/pkg/runutil" ) @@ -57,7 +58,7 @@ const ( var DefaultConfig = Config{ PutUserMetadata: map[string]string{}, - HTTPConfig: HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -71,18 +72,18 @@ var DefaultConfig = Config{ // Config stores the configuration for s3 bucket. type Config struct { - Bucket string `yaml:"bucket"` - Endpoint string `yaml:"endpoint"` - Region string `yaml:"region"` - AWSSDKAuth bool `yaml:"aws_sdk_auth"` - AccessKey string `yaml:"access_key"` - Insecure bool `yaml:"insecure"` - SignatureV2 bool `yaml:"signature_version2"` - SecretKey string `yaml:"secret_key"` - PutUserMetadata map[string]string `yaml:"put_user_metadata"` - HTTPConfig HTTPConfig `yaml:"http_config"` - TraceConfig TraceConfig `yaml:"trace"` - ListObjectsVersion string `yaml:"list_objects_version"` + Bucket string `yaml:"bucket"` + Endpoint string `yaml:"endpoint"` + Region string `yaml:"region"` + AWSSDKAuth bool `yaml:"aws_sdk_auth"` + AccessKey string `yaml:"access_key"` + Insecure bool `yaml:"insecure"` + SignatureV2 bool `yaml:"signature_version2"` + SecretKey string `yaml:"secret_key"` + PutUserMetadata map[string]string `yaml:"put_user_metadata"` + HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` + TraceConfig TraceConfig `yaml:"trace"` + ListObjectsVersion string `yaml:"list_objects_version"` // PartSize used for multipart upload. Only used if uploaded object size is known and larger than configured PartSize. // NOTE we need to make sure this number does not produce more parts than 10 000. PartSize uint64 `yaml:"part_size"` @@ -103,66 +104,6 @@ type TraceConfig struct { Enable bool `yaml:"enable"` } -// HTTPConfig stores the http.Transport configuration for the s3 minio client. -type HTTPConfig struct { - IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` - ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` - InsecureSkipVerify bool `yaml:"insecure_skip_verify"` - - TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` - ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` - MaxIdleConns int `yaml:"max_idle_conns"` - MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` - MaxConnsPerHost int `yaml:"max_conns_per_host"` - - // Allow upstream callers to inject a round tripper - Transport http.RoundTripper `yaml:"-"` - - TLSConfig objstore.TLSConfig `yaml:"tls_config"` -} - -// DefaultTransport - this default transport is based on the Minio -// DefaultTransport up until the following commit: -// https://github.com/minio/minio-go/commit/008c7aa71fc17e11bf980c209a4f8c4d687fc884 -// The values have since diverged. -func DefaultTransport(config Config) (*http.Transport, error) { - tlsConfig, err := objstore.NewTLSConfig(&config.HTTPConfig.TLSConfig) - if err != nil { - return nil, err - } - - if config.HTTPConfig.InsecureSkipVerify { - tlsConfig.InsecureSkipVerify = true - } - - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - - MaxIdleConns: config.HTTPConfig.MaxIdleConns, - MaxIdleConnsPerHost: config.HTTPConfig.MaxIdleConnsPerHost, - IdleConnTimeout: time.Duration(config.HTTPConfig.IdleConnTimeout), - MaxConnsPerHost: config.HTTPConfig.MaxConnsPerHost, - TLSHandshakeTimeout: time.Duration(config.HTTPConfig.TLSHandshakeTimeout), - ExpectContinueTimeout: time.Duration(config.HTTPConfig.ExpectContinueTimeout), - // A custom ResponseHeaderTimeout was introduced - // to cover cases where the tcp connection works but - // the server never answers. Defaults to 2 minutes. - ResponseHeaderTimeout: time.Duration(config.HTTPConfig.ResponseHeaderTimeout), - // Set this value so that the underlying transport round-tripper - // doesn't try to auto decode the body of objects with - // content-encoding set to `gzip`. - // - // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. - DisableCompression: true, - TLSClientConfig: tlsConfig, - }, nil -} - // Bucket implements the store.Bucket interface against s3-compatible APIs. type Bucket struct { logger log.Logger @@ -258,7 +199,7 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B rt = config.HTTPConfig.Transport } else { var err error - rt, err = DefaultTransport(config) + rt, err = exthttp.DefaultTransport(config.HTTPConfig) if err != nil { return nil, err } diff --git a/pkg/objstore/s3/s3_test.go b/pkg/objstore/s3/s3_test.go index f72ae89088..6ce6bd43b8 100644 --- a/pkg/objstore/s3/s3_test.go +++ b/pkg/objstore/s3/s3_test.go @@ -17,6 +17,7 @@ import ( "github.com/go-kit/log" "github.com/minio/minio-go/v7/pkg/encrypt" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -198,7 +199,7 @@ http_config: `) cfg, err := parseConfig(input) testutil.Ok(t, err) - transport, err := DefaultTransport(cfg) + transport, err := exthttp.DefaultTransport(cfg.HTTPConfig) testutil.Ok(t, err) testutil.Equals(t, true, transport.TLSClientConfig.InsecureSkipVerify) } diff --git a/test/e2e/e2ethanos/services.go b/test/e2e/e2ethanos/services.go index 587d9e05c3..44deed82a6 100644 --- a/test/e2e/e2ethanos/services.go +++ b/test/e2e/e2ethanos/services.go @@ -30,10 +30,12 @@ import ( "gopkg.in/yaml.v2" "github.com/thanos-io/thanos/pkg/alert" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/httpconfig" "github.com/thanos-io/thanos/pkg/objstore" "github.com/thanos-io/thanos/pkg/objstore/client" "github.com/thanos-io/thanos/pkg/objstore/s3" + "github.com/thanos-io/thanos/pkg/queryfrontend" "github.com/thanos-io/thanos/pkg/receive" ) @@ -952,7 +954,7 @@ func NewS3Config(bucket, endpoint, basePath string) s3.Config { SecretKey: e2edb.MinioSecretKey, Endpoint: endpoint, Insecure: false, - HTTPConfig: s3.HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ TLSConfig: objstore.TLSConfig{ CAFile: filepath.Join(basePath, "certs", "CAs", "ca.crt"), CertFile: filepath.Join(basePath, "certs", "public.crt"), From 5e6cb841516392610c040a20606d02eb4a5438d2 Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Fri, 24 Jun 2022 23:32:47 +0530 Subject: [PATCH 02/18] Refactoring the DefaultTransport func from s3 in package exthttp Signed-off-by: Srushti Sapkale --- pkg/exthttp/transport.go | 62 +++++++++++++++++++++++ pkg/objstore/cos/cos.go | 2 +- pkg/objstore/s3/s3.go | 91 ++++++---------------------------- pkg/objstore/s3/s3_test.go | 3 +- test/e2e/e2ethanos/services.go | 4 +- 5 files changed, 84 insertions(+), 78 deletions(-) diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index 60e82e2cc8..be58d3e7af 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -7,8 +7,28 @@ import ( "net" "net/http" "time" + + "github.com/prometheus/common/model" + "github.com/thanos-io/thanos/pkg/objstore" ) +type HTTPConfig struct { + IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` + ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` + InsecureSkipVerify bool `yaml:"insecure_skip_verify"` + + TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` + ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` + MaxIdleConns int `yaml:"max_idle_conns"` + MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` + MaxConnsPerHost int `yaml:"max_conns_per_host"` + + // Allow upstream callers to inject a round tripper + Transport http.RoundTripper `yaml:"-"` + + TLSConfig objstore.TLSConfig `yaml:"tls_config"` +} + // NewTransport creates a new http.Transport with default settings. func NewTransport() *http.Transport { return &http.Transport{ @@ -25,3 +45,45 @@ func NewTransport() *http.Transport { ExpectContinueTimeout: 1 * time.Second, } } + +// DefaultTransport - this default transport is based on the Minio +// DefaultTransport up until the following commit: +// https://github.com/minio/minio-go/commit/008c7aa71fc17e11bf980c209a4f8c4d687fc884 +// The values have since diverged. +func DefaultTransport(config HTTPConfig) (*http.Transport, error) { + tlsConfig, err := objstore.NewTLSConfig(&config.TLSConfig) + if err != nil { + return nil, err + } + + if config.InsecureSkipVerify { + tlsConfig.InsecureSkipVerify = true + } + + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + + MaxIdleConns: config.MaxIdleConns, + MaxIdleConnsPerHost: config.MaxIdleConnsPerHost, + IdleConnTimeout: time.Duration(config.IdleConnTimeout), + MaxConnsPerHost: config.MaxConnsPerHost, + TLSHandshakeTimeout: time.Duration(config.TLSHandshakeTimeout), + ExpectContinueTimeout: time.Duration(config.ExpectContinueTimeout), + // A custom ResponseHeaderTimeout was introduced + // to cover cases where the tcp connection works but + // the server never answers. Defaults to 2 minutes. + ResponseHeaderTimeout: time.Duration(config.ResponseHeaderTimeout), + // Set this value so that the underlying transport round-tripper + // doesn't try to auto decode the body of objects with + // content-encoding set to `gzip`. + // + // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. + DisableCompression: true, + TLSClientConfig: tlsConfig, + }, nil +} diff --git a/pkg/objstore/cos/cos.go b/pkg/objstore/cos/cos.go index 91529db2a5..3e1e9e2e46 100644 --- a/pkg/objstore/cos/cos.go +++ b/pkg/objstore/cos/cos.go @@ -105,7 +105,6 @@ type HTTPConfig struct { MaxConnsPerHost int `yaml:"max_conns_per_host"` } -// DefaultTransport build http.Transport from config. func DefaultTransport(c HTTPConfig) *http.Transport { transport := exthttp.NewTransport() transport.IdleConnTimeout = time.Duration(c.IdleConnTimeout) @@ -149,6 +148,7 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B bucketURL = cos.NewBucketURL(fmt.Sprintf("%s-%s", config.Bucket, config.AppId), config.Region, true) } b := &cos.BaseURL{BucketURL: bucketURL} + client := cos.NewClient(b, &http.Client{ Transport: &cos.AuthorizationTransport{ SecretID: config.SecretId, diff --git a/pkg/objstore/s3/s3.go b/pkg/objstore/s3/s3.go index 1ece1a51f8..50bad1dc34 100644 --- a/pkg/objstore/s3/s3.go +++ b/pkg/objstore/s3/s3.go @@ -9,7 +9,6 @@ import ( "fmt" "io" "io/ioutil" - "net" "net/http" "os" "runtime" @@ -28,7 +27,9 @@ import ( "github.com/prometheus/common/version" "gopkg.in/yaml.v2" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/objstore" + "github.com/thanos-io/thanos/pkg/runutil" ) @@ -57,7 +58,7 @@ const ( var DefaultConfig = Config{ PutUserMetadata: map[string]string{}, - HTTPConfig: HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -71,18 +72,18 @@ var DefaultConfig = Config{ // Config stores the configuration for s3 bucket. type Config struct { - Bucket string `yaml:"bucket"` - Endpoint string `yaml:"endpoint"` - Region string `yaml:"region"` - AWSSDKAuth bool `yaml:"aws_sdk_auth"` - AccessKey string `yaml:"access_key"` - Insecure bool `yaml:"insecure"` - SignatureV2 bool `yaml:"signature_version2"` - SecretKey string `yaml:"secret_key"` - PutUserMetadata map[string]string `yaml:"put_user_metadata"` - HTTPConfig HTTPConfig `yaml:"http_config"` - TraceConfig TraceConfig `yaml:"trace"` - ListObjectsVersion string `yaml:"list_objects_version"` + Bucket string `yaml:"bucket"` + Endpoint string `yaml:"endpoint"` + Region string `yaml:"region"` + AWSSDKAuth bool `yaml:"aws_sdk_auth"` + AccessKey string `yaml:"access_key"` + Insecure bool `yaml:"insecure"` + SignatureV2 bool `yaml:"signature_version2"` + SecretKey string `yaml:"secret_key"` + PutUserMetadata map[string]string `yaml:"put_user_metadata"` + HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` + TraceConfig TraceConfig `yaml:"trace"` + ListObjectsVersion string `yaml:"list_objects_version"` // PartSize used for multipart upload. Only used if uploaded object size is known and larger than configured PartSize. // NOTE we need to make sure this number does not produce more parts than 10 000. PartSize uint64 `yaml:"part_size"` @@ -103,66 +104,6 @@ type TraceConfig struct { Enable bool `yaml:"enable"` } -// HTTPConfig stores the http.Transport configuration for the s3 minio client. -type HTTPConfig struct { - IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` - ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` - InsecureSkipVerify bool `yaml:"insecure_skip_verify"` - - TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` - ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` - MaxIdleConns int `yaml:"max_idle_conns"` - MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` - MaxConnsPerHost int `yaml:"max_conns_per_host"` - - // Allow upstream callers to inject a round tripper - Transport http.RoundTripper `yaml:"-"` - - TLSConfig objstore.TLSConfig `yaml:"tls_config"` -} - -// DefaultTransport - this default transport is based on the Minio -// DefaultTransport up until the following commit: -// https://github.com/minio/minio-go/commit/008c7aa71fc17e11bf980c209a4f8c4d687fc884 -// The values have since diverged. -func DefaultTransport(config Config) (*http.Transport, error) { - tlsConfig, err := objstore.NewTLSConfig(&config.HTTPConfig.TLSConfig) - if err != nil { - return nil, err - } - - if config.HTTPConfig.InsecureSkipVerify { - tlsConfig.InsecureSkipVerify = true - } - - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - - MaxIdleConns: config.HTTPConfig.MaxIdleConns, - MaxIdleConnsPerHost: config.HTTPConfig.MaxIdleConnsPerHost, - IdleConnTimeout: time.Duration(config.HTTPConfig.IdleConnTimeout), - MaxConnsPerHost: config.HTTPConfig.MaxConnsPerHost, - TLSHandshakeTimeout: time.Duration(config.HTTPConfig.TLSHandshakeTimeout), - ExpectContinueTimeout: time.Duration(config.HTTPConfig.ExpectContinueTimeout), - // A custom ResponseHeaderTimeout was introduced - // to cover cases where the tcp connection works but - // the server never answers. Defaults to 2 minutes. - ResponseHeaderTimeout: time.Duration(config.HTTPConfig.ResponseHeaderTimeout), - // Set this value so that the underlying transport round-tripper - // doesn't try to auto decode the body of objects with - // content-encoding set to `gzip`. - // - // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. - DisableCompression: true, - TLSClientConfig: tlsConfig, - }, nil -} - // Bucket implements the store.Bucket interface against s3-compatible APIs. type Bucket struct { logger log.Logger @@ -258,7 +199,7 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B rt = config.HTTPConfig.Transport } else { var err error - rt, err = DefaultTransport(config) + rt, err = exthttp.DefaultTransport(config.HTTPConfig) if err != nil { return nil, err } diff --git a/pkg/objstore/s3/s3_test.go b/pkg/objstore/s3/s3_test.go index f72ae89088..6ce6bd43b8 100644 --- a/pkg/objstore/s3/s3_test.go +++ b/pkg/objstore/s3/s3_test.go @@ -17,6 +17,7 @@ import ( "github.com/go-kit/log" "github.com/minio/minio-go/v7/pkg/encrypt" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -198,7 +199,7 @@ http_config: `) cfg, err := parseConfig(input) testutil.Ok(t, err) - transport, err := DefaultTransport(cfg) + transport, err := exthttp.DefaultTransport(cfg.HTTPConfig) testutil.Ok(t, err) testutil.Equals(t, true, transport.TLSClientConfig.InsecureSkipVerify) } diff --git a/test/e2e/e2ethanos/services.go b/test/e2e/e2ethanos/services.go index 587d9e05c3..44deed82a6 100644 --- a/test/e2e/e2ethanos/services.go +++ b/test/e2e/e2ethanos/services.go @@ -30,10 +30,12 @@ import ( "gopkg.in/yaml.v2" "github.com/thanos-io/thanos/pkg/alert" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/httpconfig" "github.com/thanos-io/thanos/pkg/objstore" "github.com/thanos-io/thanos/pkg/objstore/client" "github.com/thanos-io/thanos/pkg/objstore/s3" + "github.com/thanos-io/thanos/pkg/queryfrontend" "github.com/thanos-io/thanos/pkg/receive" ) @@ -952,7 +954,7 @@ func NewS3Config(bucket, endpoint, basePath string) s3.Config { SecretKey: e2edb.MinioSecretKey, Endpoint: endpoint, Insecure: false, - HTTPConfig: s3.HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ TLSConfig: objstore.TLSConfig{ CAFile: filepath.Join(basePath, "certs", "CAs", "ca.crt"), CertFile: filepath.Join(basePath, "certs", "public.crt"), From b98372c3f10638507a882cec42f11f98e042f8ff Mon Sep 17 00:00:00 2001 From: "Srushti (sroo-sh-tee)" <73685894+SrushtiSapkale@users.noreply.github.com> Date: Mon, 27 Jun 2022 10:24:03 +0530 Subject: [PATCH 03/18] Updated helpers.go corrected argument for DefaultTransport() in helpers.go Signed-off-by: Srushti (sroo-sh-tee) <73685894+SrushtiSapkale@users.noreply.github.com> --- pkg/objstore/azure/helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/objstore/azure/helpers.go b/pkg/objstore/azure/helpers.go index e044159504..5c2d7af778 100644 --- a/pkg/objstore/azure/helpers.go +++ b/pkg/objstore/azure/helpers.go @@ -106,7 +106,7 @@ func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob. retryOptions.TryTimeout = time.Until(deadline) } - dt, err := exthttp.DefaultTransport(conf.HTTPConfig) + dt, err := exthttp.DefaultTransport(exthttp.HTTPConfig) if err != nil { return blob.ContainerURL{}, err } From 97653917b3a107ff5b91da40aff2e3f738987df8 Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Tue, 28 Jun 2022 15:04:11 +0530 Subject: [PATCH 04/18] Changed the argument type in getContainerURL Signed-off-by: Srushti Sapkale --- pkg/exthttp/transport.go | 3 ++- pkg/objstore/azure/azure.go | 38 ++++++++++---------------------- pkg/objstore/azure/azure_test.go | 2 +- pkg/objstore/azure/helpers.go | 4 +--- 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index be58d3e7af..dd873c987a 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -26,7 +26,8 @@ type HTTPConfig struct { // Allow upstream callers to inject a round tripper Transport http.RoundTripper `yaml:"-"` - TLSConfig objstore.TLSConfig `yaml:"tls_config"` + TLSConfig objstore.TLSConfig `yaml:"tls_config"` + DisableCompression bool } // NewTransport creates a new http.Transport with default settings. diff --git a/pkg/objstore/azure/azure.go b/pkg/objstore/azure/azure.go index f79b7df237..6ff7ee856b 100644 --- a/pkg/objstore/azure/azure.go +++ b/pkg/objstore/azure/azure.go @@ -20,6 +20,7 @@ import ( "github.com/prometheus/common/model" "gopkg.in/yaml.v2" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/objstore" ) @@ -38,7 +39,7 @@ var DefaultConfig = Config{ ReaderConfig: ReaderConfig{ MaxRetryRequests: 0, }, - HTTPConfig: HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -52,16 +53,16 @@ var DefaultConfig = Config{ // Config Azure storage configuration. type Config struct { - StorageAccountName string `yaml:"storage_account"` - StorageAccountKey string `yaml:"storage_account_key"` - ContainerName string `yaml:"container"` - Endpoint string `yaml:"endpoint"` - MaxRetries int `yaml:"max_retries"` - MSIResource string `yaml:"msi_resource"` - UserAssignedID string `yaml:"user_assigned_id"` - PipelineConfig PipelineConfig `yaml:"pipeline_config"` - ReaderConfig ReaderConfig `yaml:"reader_config"` - HTTPConfig HTTPConfig `yaml:"http_config"` + StorageAccountName string `yaml:"storage_account"` + StorageAccountKey string `yaml:"storage_account_key"` + ContainerName string `yaml:"container"` + Endpoint string `yaml:"endpoint"` + MaxRetries int `yaml:"max_retries"` + MSIResource string `yaml:"msi_resource"` + UserAssignedID string `yaml:"user_assigned_id"` + PipelineConfig PipelineConfig `yaml:"pipeline_config"` + ReaderConfig ReaderConfig `yaml:"reader_config"` + HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` } type ReaderConfig struct { @@ -75,21 +76,6 @@ type PipelineConfig struct { MaxRetryDelay model.Duration `yaml:"max_retry_delay"` } -type HTTPConfig struct { - IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` - ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` - InsecureSkipVerify bool `yaml:"insecure_skip_verify"` - - TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` - ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` - MaxIdleConns int `yaml:"max_idle_conns"` - MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` - MaxConnsPerHost int `yaml:"max_conns_per_host"` - DisableCompression bool `yaml:"disable_compression"` - - TLSConfig objstore.TLSConfig `yaml:"tls_config"` -} - // Bucket implements the store.Bucket interface against Azure APIs. type Bucket struct { logger log.Logger diff --git a/pkg/objstore/azure/azure_test.go b/pkg/objstore/azure/azure_test.go index 21d16f8cd3..fcf51e0a10 100644 --- a/pkg/objstore/azure/azure_test.go +++ b/pkg/objstore/azure/azure_test.go @@ -236,7 +236,7 @@ http_config: `) cfg, err := parseConfig(input) testutil.Ok(t, err) - transport, err := exthttp.DefaultTransport(cfg) + transport, err := exthttp.DefaultTransport(cfg.HTTPConfig) testutil.Ok(t, err) testutil.Equals(t, true, transport.TLSClientConfig.InsecureSkipVerify) } diff --git a/pkg/objstore/azure/helpers.go b/pkg/objstore/azure/helpers.go index 5c2d7af778..a5e27fc022 100644 --- a/pkg/objstore/azure/helpers.go +++ b/pkg/objstore/azure/helpers.go @@ -7,7 +7,6 @@ import ( "context" "fmt" - //"net" "net/http" "net/url" "regexp" @@ -20,7 +19,6 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/thanos-io/thanos/pkg/exthttp" - //"github.com/thanos-io/thanos/pkg/objstore" ) // DirDelim is the delimiter used to model a directory structure in an object store bucket. @@ -106,7 +104,7 @@ func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob. retryOptions.TryTimeout = time.Until(deadline) } - dt, err := exthttp.DefaultTransport(exthttp.HTTPConfig) + dt, err := exthttp.DefaultTransport(conf.HTTPConfig) if err != nil { return blob.ContainerURL{}, err } From 55fd8bc9583a3775ece63ba58a9ff4455d7b38f7 Mon Sep 17 00:00:00 2001 From: "Srushti (sroo-sh-tee)" <73685894+SrushtiSapkale@users.noreply.github.com> Date: Tue, 28 Jun 2022 15:23:45 +0530 Subject: [PATCH 05/18] Update pkg/exthttp/transport.go Co-authored-by: Bartlomiej Plotka Signed-off-by: Srushti (sroo-sh-tee) <73685894+SrushtiSapkale@users.noreply.github.com> --- pkg/exthttp/transport.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index dd873c987a..4803604cd6 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -57,9 +57,7 @@ func DefaultTransport(config HTTPConfig) (*http.Transport, error) { return nil, err } - if config.InsecureSkipVerify { - tlsConfig.InsecureSkipVerify = true - } +config.InsecureSkipVerify = tlsConfig.InsecureSkipVerify return &http.Transport{ Proxy: http.ProxyFromEnvironment, From 7f5d8be72d59e8b35c28690cd595d06f1e7ae542 Mon Sep 17 00:00:00 2001 From: "Srushti (sroo-sh-tee)" <73685894+SrushtiSapkale@users.noreply.github.com> Date: Tue, 28 Jun 2022 15:24:13 +0530 Subject: [PATCH 06/18] Update pkg/exthttp/transport.go Co-authored-by: Bartlomiej Plotka Signed-off-by: Srushti (sroo-sh-tee) <73685894+SrushtiSapkale@users.noreply.github.com> --- pkg/exthttp/transport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index 4803604cd6..e8162405d0 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -23,7 +23,7 @@ type HTTPConfig struct { MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` MaxConnsPerHost int `yaml:"max_conns_per_host"` - // Allow upstream callers to inject a round tripper + // Transport field allows upstream callers to inject a custom round tripper. Transport http.RoundTripper `yaml:"-"` TLSConfig objstore.TLSConfig `yaml:"tls_config"` From b81eeace6b8f9dcc857834a022655a83c3e80c9c Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Tue, 28 Jun 2022 18:36:05 +0530 Subject: [PATCH 07/18] Removed the use of NewTransport() in cos.go Signed-off-by: Srushti Sapkale --- pkg/exthttp/transport.go | 2 +- pkg/objstore/cos/cos.go | 32 ++++++++++---------------------- pkg/objstore/cos/cos_test.go | 5 +++-- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index e8162405d0..a2c635bafc 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -57,7 +57,7 @@ func DefaultTransport(config HTTPConfig) (*http.Transport, error) { return nil, err } -config.InsecureSkipVerify = tlsConfig.InsecureSkipVerify + config.InsecureSkipVerify = tlsConfig.InsecureSkipVerify return &http.Transport{ Proxy: http.ProxyFromEnvironment, diff --git a/pkg/objstore/cos/cos.go b/pkg/objstore/cos/cos.go index 3e1e9e2e46..b97f204552 100644 --- a/pkg/objstore/cos/cos.go +++ b/pkg/objstore/cos/cos.go @@ -40,7 +40,7 @@ type Bucket struct { // DefaultConfig is the default config for an cos client. default tune the `MaxIdleConnsPerHost`. var DefaultConfig = Config{ - HTTPConfig: HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -53,13 +53,13 @@ var DefaultConfig = Config{ // Config encapsulates the necessary config values to instantiate an cos client. type Config struct { - Bucket string `yaml:"bucket"` - Region string `yaml:"region"` - AppId string `yaml:"app_id"` - Endpoint string `yaml:"endpoint"` - SecretKey string `yaml:"secret_key"` - SecretId string `yaml:"secret_id"` - HTTPConfig HTTPConfig `yaml:"http_config"` + Bucket string `yaml:"bucket"` + Region string `yaml:"region"` + AppId string `yaml:"app_id"` + Endpoint string `yaml:"endpoint"` + SecretKey string `yaml:"secret_key"` + SecretId string `yaml:"secret_id"` + HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` } // Validate checks to see if mandatory cos config options are set. @@ -105,18 +105,6 @@ type HTTPConfig struct { MaxConnsPerHost int `yaml:"max_conns_per_host"` } -func DefaultTransport(c HTTPConfig) *http.Transport { - transport := exthttp.NewTransport() - transport.IdleConnTimeout = time.Duration(c.IdleConnTimeout) - transport.ResponseHeaderTimeout = time.Duration(c.ResponseHeaderTimeout) - transport.TLSHandshakeTimeout = time.Duration(c.TLSHandshakeTimeout) - transport.ExpectContinueTimeout = time.Duration(c.ExpectContinueTimeout) - transport.MaxIdleConns = c.MaxIdleConns - transport.MaxIdleConnsPerHost = c.MaxIdleConnsPerHost - transport.MaxConnsPerHost = c.MaxConnsPerHost - return transport -} - // NewBucket returns a new Bucket using the provided cos configuration. func NewBucket(logger log.Logger, conf []byte, component string) (*Bucket, error) { if logger == nil { @@ -148,12 +136,12 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B bucketURL = cos.NewBucketURL(fmt.Sprintf("%s-%s", config.Bucket, config.AppId), config.Region, true) } b := &cos.BaseURL{BucketURL: bucketURL} - + tpt, err := exthttp.DefaultTransport(config.HTTPConfig) client := cos.NewClient(b, &http.Client{ Transport: &cos.AuthorizationTransport{ SecretID: config.SecretId, SecretKey: config.SecretKey, - Transport: DefaultTransport(config.HTTPConfig), + Transport: tpt, }, }) diff --git a/pkg/objstore/cos/cos_test.go b/pkg/objstore/cos/cos_test.go index 12f175de1a..cc9432e97c 100644 --- a/pkg/objstore/cos/cos_test.go +++ b/pkg/objstore/cos/cos_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/prometheus/common/model" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -38,7 +39,7 @@ http_config: `), }, want: Config{ - HTTPConfig: HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -71,7 +72,7 @@ func TestConfig_validate(t *testing.T) { Endpoint string SecretKey string SecretId string - HTTPConfig HTTPConfig + HTTPConfig exthttp.HTTPConfig } tests := []struct { name string From 141f32e39cc24422fdb2c020aec7d46f22b71faf Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Tue, 28 Jun 2022 21:29:33 +0530 Subject: [PATCH 08/18] Moved TLSConfig struct and functions that need it from objstore to exthttp Signed-off-by: Srushti Sapkale --- pkg/exthttp/transport.go | 85 +++++++++++++++++++++++++++++++-- pkg/objstore/tlsconfig.go | 87 ---------------------------------- test/e2e/e2ethanos/services.go | 3 +- 3 files changed, 83 insertions(+), 92 deletions(-) delete mode 100644 pkg/objstore/tlsconfig.go diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index a2c635bafc..1828310f09 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -4,14 +4,31 @@ package exthttp import ( + "crypto/tls" + "crypto/x509" + "fmt" + "io/ioutil" "net" "net/http" "time" "github.com/prometheus/common/model" - "github.com/thanos-io/thanos/pkg/objstore" ) +// TLSConfig configures the options for TLS connections. +type TLSConfig struct { + // The CA cert to use for the targets. + CAFile string `yaml:"ca_file"` + // The client cert file for the targets. + CertFile string `yaml:"cert_file"` + // The client key file for the targets. + KeyFile string `yaml:"key_file"` + // Used to verify the hostname for the targets. + ServerName string `yaml:"server_name"` + // Disable target certificate validation. + InsecureSkipVerify bool `yaml:"insecure_skip_verify"` +} + type HTTPConfig struct { IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` @@ -26,7 +43,7 @@ type HTTPConfig struct { // Transport field allows upstream callers to inject a custom round tripper. Transport http.RoundTripper `yaml:"-"` - TLSConfig objstore.TLSConfig `yaml:"tls_config"` + TLSConfig TLSConfig `yaml:"tls_config"` DisableCompression bool } @@ -52,7 +69,7 @@ func NewTransport() *http.Transport { // https://github.com/minio/minio-go/commit/008c7aa71fc17e11bf980c209a4f8c4d687fc884 // The values have since diverged. func DefaultTransport(config HTTPConfig) (*http.Transport, error) { - tlsConfig, err := objstore.NewTLSConfig(&config.TLSConfig) + tlsConfig, err := NewTLSConfig(&config.TLSConfig) if err != nil { return nil, err } @@ -86,3 +103,65 @@ func DefaultTransport(config HTTPConfig) (*http.Transport, error) { TLSClientConfig: tlsConfig, }, nil } + +// NewTLSConfig creates a new tls.Config from the given TLSConfig. +func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) { + tlsConfig := &tls.Config{InsecureSkipVerify: cfg.InsecureSkipVerify} + + // If a CA cert is provided then let's read it in. + if len(cfg.CAFile) > 0 { + b, err := readCAFile(cfg.CAFile) + if err != nil { + return nil, err + } + if !updateRootCA(tlsConfig, b) { + return nil, fmt.Errorf("unable to use specified CA cert %s", cfg.CAFile) + } + } + + if len(cfg.ServerName) > 0 { + tlsConfig.ServerName = cfg.ServerName + } + // If a client cert & key is provided then configure TLS config accordingly. + if len(cfg.CertFile) > 0 && len(cfg.KeyFile) == 0 { + return nil, fmt.Errorf("client cert file %q specified without client key file", cfg.CertFile) + } else if len(cfg.KeyFile) > 0 && len(cfg.CertFile) == 0 { + return nil, fmt.Errorf("client key file %q specified without client cert file", cfg.KeyFile) + } else if len(cfg.CertFile) > 0 && len(cfg.KeyFile) > 0 { + // Verify that client cert and key are valid. + if _, err := cfg.getClientCertificate(nil); err != nil { + return nil, err + } + tlsConfig.GetClientCertificate = cfg.getClientCertificate + } + + return tlsConfig, nil +} + +// readCAFile reads the CA cert file from disk. +func readCAFile(f string) ([]byte, error) { + data, err := ioutil.ReadFile(f) + if err != nil { + return nil, fmt.Errorf("unable to load specified CA cert %s: %s", f, err) + } + return data, nil +} + +// updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs. +func updateRootCA(cfg *tls.Config, b []byte) bool { + caCertPool := x509.NewCertPool() + if !caCertPool.AppendCertsFromPEM(b) { + return false + } + cfg.RootCAs = caCertPool + return true +} + +// getClientCertificate reads the pair of client cert and key from disk and returns a tls.Certificate. +func (c *TLSConfig) getClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error) { + cert, err := tls.LoadX509KeyPair(c.CertFile, c.KeyFile) + if err != nil { + return nil, fmt.Errorf("unable to use specified client cert (%s) & key (%s): %s", c.CertFile, c.KeyFile, err) + } + return &cert, nil +} diff --git a/pkg/objstore/tlsconfig.go b/pkg/objstore/tlsconfig.go deleted file mode 100644 index f705fa31b6..0000000000 --- a/pkg/objstore/tlsconfig.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -package objstore - -import ( - "crypto/tls" - "crypto/x509" - "fmt" - "io/ioutil" -) - -// NewTLSConfig creates a new tls.Config from the given TLSConfig. -func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) { - tlsConfig := &tls.Config{InsecureSkipVerify: cfg.InsecureSkipVerify} - - // If a CA cert is provided then let's read it in. - if len(cfg.CAFile) > 0 { - b, err := readCAFile(cfg.CAFile) - if err != nil { - return nil, err - } - if !updateRootCA(tlsConfig, b) { - return nil, fmt.Errorf("unable to use specified CA cert %s", cfg.CAFile) - } - } - - if len(cfg.ServerName) > 0 { - tlsConfig.ServerName = cfg.ServerName - } - // If a client cert & key is provided then configure TLS config accordingly. - if len(cfg.CertFile) > 0 && len(cfg.KeyFile) == 0 { - return nil, fmt.Errorf("client cert file %q specified without client key file", cfg.CertFile) - } else if len(cfg.KeyFile) > 0 && len(cfg.CertFile) == 0 { - return nil, fmt.Errorf("client key file %q specified without client cert file", cfg.KeyFile) - } else if len(cfg.CertFile) > 0 && len(cfg.KeyFile) > 0 { - // Verify that client cert and key are valid. - if _, err := cfg.getClientCertificate(nil); err != nil { - return nil, err - } - tlsConfig.GetClientCertificate = cfg.getClientCertificate - } - - return tlsConfig, nil -} - -// readCAFile reads the CA cert file from disk. -func readCAFile(f string) ([]byte, error) { - data, err := ioutil.ReadFile(f) - if err != nil { - return nil, fmt.Errorf("unable to load specified CA cert %s: %s", f, err) - } - return data, nil -} - -// updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs. -func updateRootCA(cfg *tls.Config, b []byte) bool { - caCertPool := x509.NewCertPool() - if !caCertPool.AppendCertsFromPEM(b) { - return false - } - cfg.RootCAs = caCertPool - return true -} - -// getClientCertificate reads the pair of client cert and key from disk and returns a tls.Certificate. -func (c *TLSConfig) getClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error) { - cert, err := tls.LoadX509KeyPair(c.CertFile, c.KeyFile) - if err != nil { - return nil, fmt.Errorf("unable to use specified client cert (%s) & key (%s): %s", c.CertFile, c.KeyFile, err) - } - return &cert, nil -} - -// TLSConfig configures the options for TLS connections. -type TLSConfig struct { - // The CA cert to use for the targets. - CAFile string `yaml:"ca_file"` - // The client cert file for the targets. - CertFile string `yaml:"cert_file"` - // The client key file for the targets. - KeyFile string `yaml:"key_file"` - // Used to verify the hostname for the targets. - ServerName string `yaml:"server_name"` - // Disable target certificate validation. - InsecureSkipVerify bool `yaml:"insecure_skip_verify"` -} diff --git a/test/e2e/e2ethanos/services.go b/test/e2e/e2ethanos/services.go index 44deed82a6..3b493f1a93 100644 --- a/test/e2e/e2ethanos/services.go +++ b/test/e2e/e2ethanos/services.go @@ -32,7 +32,6 @@ import ( "github.com/thanos-io/thanos/pkg/alert" "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/httpconfig" - "github.com/thanos-io/thanos/pkg/objstore" "github.com/thanos-io/thanos/pkg/objstore/client" "github.com/thanos-io/thanos/pkg/objstore/s3" @@ -955,7 +954,7 @@ func NewS3Config(bucket, endpoint, basePath string) s3.Config { Endpoint: endpoint, Insecure: false, HTTPConfig: exthttp.HTTPConfig{ - TLSConfig: objstore.TLSConfig{ + TLSConfig: exthttp.TLSConfig{ CAFile: filepath.Join(basePath, "certs", "CAs", "ca.crt"), CertFile: filepath.Join(basePath, "certs", "public.crt"), KeyFile: filepath.Join(basePath, "certs", "private.key"), From 8b9377fb27fb0c9c7517313d9b62218908202db4 Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Wed, 29 Jun 2022 15:23:02 +0530 Subject: [PATCH 09/18] Changed s3.go Signed-off-by: Srushti Sapkale --- pkg/objstore/s3/s3.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/objstore/s3/s3.go b/pkg/objstore/s3/s3.go index 50bad1dc34..afefba5105 100644 --- a/pkg/objstore/s3/s3.go +++ b/pkg/objstore/s3/s3.go @@ -70,6 +70,24 @@ var DefaultConfig = Config{ PartSize: 1024 * 1024 * 64, // 64MB. } +type HTTPConfig struct { + IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` + ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` + InsecureSkipVerify bool `yaml:"insecure_skip_verify"` + + TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` + ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` + MaxIdleConns int `yaml:"max_idle_conns"` + MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` + MaxConnsPerHost int `yaml:"max_conns_per_host"` + + // Transport field allows upstream callers to inject a custom round tripper. + Transport http.RoundTripper `yaml:"-"` + + TLSConfig exthttp.TLSConfig `yaml:"tls_config"` + DisableCompression bool +} + // Config stores the configuration for s3 bucket. type Config struct { Bucket string `yaml:"bucket"` From df1c015327e2a059fe3724e0a2ad02ceebe9c748 Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Wed, 29 Jun 2022 16:03:38 +0530 Subject: [PATCH 10/18] Kept s3.go and helpers.go unchanged to not break the cortex deps Signed-off-by: Srushti Sapkale --- pkg/objstore/azure/azure.go | 41 ++++++++++++++------ pkg/objstore/azure/azure_test.go | 3 +- pkg/objstore/azure/helpers.go | 39 ++++++++++++++++++- pkg/objstore/s3/s3.go | 65 +++++++++++++++++++++++++------- pkg/objstore/s3/s3_test.go | 3 +- test/e2e/e2ethanos/services.go | 2 +- 6 files changed, 122 insertions(+), 31 deletions(-) diff --git a/pkg/objstore/azure/azure.go b/pkg/objstore/azure/azure.go index 6ff7ee856b..07e316c9f4 100644 --- a/pkg/objstore/azure/azure.go +++ b/pkg/objstore/azure/azure.go @@ -8,6 +8,7 @@ import ( "context" "io" "io/ioutil" + "net/http" "os" "strings" "testing" @@ -39,7 +40,7 @@ var DefaultConfig = Config{ ReaderConfig: ReaderConfig{ MaxRetryRequests: 0, }, - HTTPConfig: exthttp.HTTPConfig{ + HTTPConfig: HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -53,16 +54,16 @@ var DefaultConfig = Config{ // Config Azure storage configuration. type Config struct { - StorageAccountName string `yaml:"storage_account"` - StorageAccountKey string `yaml:"storage_account_key"` - ContainerName string `yaml:"container"` - Endpoint string `yaml:"endpoint"` - MaxRetries int `yaml:"max_retries"` - MSIResource string `yaml:"msi_resource"` - UserAssignedID string `yaml:"user_assigned_id"` - PipelineConfig PipelineConfig `yaml:"pipeline_config"` - ReaderConfig ReaderConfig `yaml:"reader_config"` - HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` + StorageAccountName string `yaml:"storage_account"` + StorageAccountKey string `yaml:"storage_account_key"` + ContainerName string `yaml:"container"` + Endpoint string `yaml:"endpoint"` + MaxRetries int `yaml:"max_retries"` + MSIResource string `yaml:"msi_resource"` + UserAssignedID string `yaml:"user_assigned_id"` + PipelineConfig PipelineConfig `yaml:"pipeline_config"` + ReaderConfig ReaderConfig `yaml:"reader_config"` + HTTPConfig HTTPConfig `yaml:"http_config"` } type ReaderConfig struct { @@ -138,6 +139,24 @@ func (conf *Config) validate() error { return nil } +type HTTPConfig struct { + IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` + ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` + InsecureSkipVerify bool `yaml:"insecure_skip_verify"` + + TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` + ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` + MaxIdleConns int `yaml:"max_idle_conns"` + MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` + MaxConnsPerHost int `yaml:"max_conns_per_host"` + + // Transport field allows upstream callers to inject a custom round tripper. + Transport http.RoundTripper `yaml:"-"` + + TLSConfig exthttp.TLSConfig `yaml:"tls_config"` + DisableCompression bool +} + // parseConfig unmarshals a buffer into a Config with default values. func parseConfig(conf []byte) (Config, error) { config := DefaultConfig diff --git a/pkg/objstore/azure/azure_test.go b/pkg/objstore/azure/azure_test.go index fcf51e0a10..41a61430ee 100644 --- a/pkg/objstore/azure/azure_test.go +++ b/pkg/objstore/azure/azure_test.go @@ -7,7 +7,6 @@ import ( "testing" "time" - "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -236,7 +235,7 @@ http_config: `) cfg, err := parseConfig(input) testutil.Ok(t, err) - transport, err := exthttp.DefaultTransport(cfg.HTTPConfig) + transport, err := DefaultTransport(cfg.HTTPConfig) testutil.Ok(t, err) testutil.Equals(t, true, transport.TLSClientConfig.InsecureSkipVerify) } diff --git a/pkg/objstore/azure/helpers.go b/pkg/objstore/azure/helpers.go index a5e27fc022..8642bb11bd 100644 --- a/pkg/objstore/azure/helpers.go +++ b/pkg/objstore/azure/helpers.go @@ -7,6 +7,7 @@ import ( "context" "fmt" + "net" "net/http" "net/url" "regexp" @@ -86,6 +87,42 @@ func getServicePrincipalToken(logger log.Logger, conf Config) (*adal.ServicePrin return msiConfig.ServicePrincipalToken() } +func DefaultTransport(config HTTPConfig) (*http.Transport, error) { + tlsConfig, err := exthttp.NewTLSConfig(&config.TLSConfig) + if err != nil { + return nil, err + } + + config.InsecureSkipVerify = tlsConfig.InsecureSkipVerify + + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + + MaxIdleConns: config.MaxIdleConns, + MaxIdleConnsPerHost: config.MaxIdleConnsPerHost, + IdleConnTimeout: time.Duration(config.IdleConnTimeout), + MaxConnsPerHost: config.MaxConnsPerHost, + TLSHandshakeTimeout: time.Duration(config.TLSHandshakeTimeout), + ExpectContinueTimeout: time.Duration(config.ExpectContinueTimeout), + // A custom ResponseHeaderTimeout was introduced + // to cover cases where the tcp connection works but + // the server never answers. Defaults to 2 minutes. + ResponseHeaderTimeout: time.Duration(config.ResponseHeaderTimeout), + // Set this value so that the underlying transport round-tripper + // doesn't try to auto decode the body of objects with + // content-encoding set to `gzip`. + // + // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. + DisableCompression: true, + TLSClientConfig: tlsConfig, + }, nil +} + func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob.ContainerURL, error) { credentials, err := getAzureStorageCredentials(logger, conf) @@ -104,7 +141,7 @@ func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob. retryOptions.TryTimeout = time.Until(deadline) } - dt, err := exthttp.DefaultTransport(conf.HTTPConfig) + dt, err := DefaultTransport(conf.HTTPConfig) if err != nil { return blob.ContainerURL{}, err } diff --git a/pkg/objstore/s3/s3.go b/pkg/objstore/s3/s3.go index afefba5105..ce9cddd26c 100644 --- a/pkg/objstore/s3/s3.go +++ b/pkg/objstore/s3/s3.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "io/ioutil" + "net" "net/http" "os" "runtime" @@ -58,7 +59,7 @@ const ( var DefaultConfig = Config{ PutUserMetadata: map[string]string{}, - HTTPConfig: exthttp.HTTPConfig{ + HTTPConfig: HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -90,18 +91,18 @@ type HTTPConfig struct { // Config stores the configuration for s3 bucket. type Config struct { - Bucket string `yaml:"bucket"` - Endpoint string `yaml:"endpoint"` - Region string `yaml:"region"` - AWSSDKAuth bool `yaml:"aws_sdk_auth"` - AccessKey string `yaml:"access_key"` - Insecure bool `yaml:"insecure"` - SignatureV2 bool `yaml:"signature_version2"` - SecretKey string `yaml:"secret_key"` - PutUserMetadata map[string]string `yaml:"put_user_metadata"` - HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` - TraceConfig TraceConfig `yaml:"trace"` - ListObjectsVersion string `yaml:"list_objects_version"` + Bucket string `yaml:"bucket"` + Endpoint string `yaml:"endpoint"` + Region string `yaml:"region"` + AWSSDKAuth bool `yaml:"aws_sdk_auth"` + AccessKey string `yaml:"access_key"` + Insecure bool `yaml:"insecure"` + SignatureV2 bool `yaml:"signature_version2"` + SecretKey string `yaml:"secret_key"` + PutUserMetadata map[string]string `yaml:"put_user_metadata"` + HTTPConfig HTTPConfig `yaml:"http_config"` + TraceConfig TraceConfig `yaml:"trace"` + ListObjectsVersion string `yaml:"list_objects_version"` // PartSize used for multipart upload. Only used if uploaded object size is known and larger than configured PartSize. // NOTE we need to make sure this number does not produce more parts than 10 000. PartSize uint64 `yaml:"part_size"` @@ -133,6 +134,42 @@ type Bucket struct { listObjectsV1 bool } +func DefaultTransport(config HTTPConfig) (*http.Transport, error) { + tlsConfig, err := exthttp.NewTLSConfig(&config.TLSConfig) + if err != nil { + return nil, err + } + + config.InsecureSkipVerify = tlsConfig.InsecureSkipVerify + + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + + MaxIdleConns: config.MaxIdleConns, + MaxIdleConnsPerHost: config.MaxIdleConnsPerHost, + IdleConnTimeout: time.Duration(config.IdleConnTimeout), + MaxConnsPerHost: config.MaxConnsPerHost, + TLSHandshakeTimeout: time.Duration(config.TLSHandshakeTimeout), + ExpectContinueTimeout: time.Duration(config.ExpectContinueTimeout), + // A custom ResponseHeaderTimeout was introduced + // to cover cases where the tcp connection works but + // the server never answers. Defaults to 2 minutes. + ResponseHeaderTimeout: time.Duration(config.ResponseHeaderTimeout), + // Set this value so that the underlying transport round-tripper + // doesn't try to auto decode the body of objects with + // content-encoding set to `gzip`. + // + // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. + DisableCompression: true, + TLSClientConfig: tlsConfig, + }, nil +} + // parseConfig unmarshals a buffer into a Config with default HTTPConfig values. func parseConfig(conf []byte) (Config, error) { config := DefaultConfig @@ -217,7 +254,7 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B rt = config.HTTPConfig.Transport } else { var err error - rt, err = exthttp.DefaultTransport(config.HTTPConfig) + rt, err = DefaultTransport(config.HTTPConfig) if err != nil { return nil, err } diff --git a/pkg/objstore/s3/s3_test.go b/pkg/objstore/s3/s3_test.go index 6ce6bd43b8..f70db95f11 100644 --- a/pkg/objstore/s3/s3_test.go +++ b/pkg/objstore/s3/s3_test.go @@ -17,7 +17,6 @@ import ( "github.com/go-kit/log" "github.com/minio/minio-go/v7/pkg/encrypt" - "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -199,7 +198,7 @@ http_config: `) cfg, err := parseConfig(input) testutil.Ok(t, err) - transport, err := exthttp.DefaultTransport(cfg.HTTPConfig) + transport, err := DefaultTransport(cfg.HTTPConfig) testutil.Ok(t, err) testutil.Equals(t, true, transport.TLSClientConfig.InsecureSkipVerify) } diff --git a/test/e2e/e2ethanos/services.go b/test/e2e/e2ethanos/services.go index 3b493f1a93..bfe7d2c2d1 100644 --- a/test/e2e/e2ethanos/services.go +++ b/test/e2e/e2ethanos/services.go @@ -953,7 +953,7 @@ func NewS3Config(bucket, endpoint, basePath string) s3.Config { SecretKey: e2edb.MinioSecretKey, Endpoint: endpoint, Insecure: false, - HTTPConfig: exthttp.HTTPConfig{ + HTTPConfig: s3.HTTPConfig{ TLSConfig: exthttp.TLSConfig{ CAFile: filepath.Join(basePath, "certs", "CAs", "ca.crt"), CertFile: filepath.Join(basePath, "certs", "public.crt"), From 22169f70162021be094d49d784d0471dd156d891 Mon Sep 17 00:00:00 2001 From: bwplotka Date: Thu, 30 Jun 2022 10:59:20 +0200 Subject: [PATCH 11/18] Consistency changed made while pair++ programming. Signed-off-by: bwplotka --- cmd/thanos/query_frontend.go | 16 +++++- pkg/exthttp/transport.go | 30 +++------- pkg/objstore/azure/azure.go | 55 ++++++------------- pkg/objstore/azure/azure_test.go | 3 +- pkg/objstore/azure/helpers.go | 40 +------------- pkg/objstore/s3/s3.go | 94 +++++++------------------------- pkg/objstore/s3/s3_test.go | 3 +- test/e2e/e2ethanos/services.go | 2 +- 8 files changed, 66 insertions(+), 177 deletions(-) diff --git a/cmd/thanos/query_frontend.go b/cmd/thanos/query_frontend.go index b6a85d3a5d..5bebbf39c2 100644 --- a/cmd/thanos/query_frontend.go +++ b/cmd/thanos/query_frontend.go @@ -4,6 +4,7 @@ package main import ( + "net" "net/http" "time" @@ -25,7 +26,6 @@ import ( "github.com/thanos-io/thanos/pkg/api" "github.com/thanos-io/thanos/pkg/component" - "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/extkingpin" "github.com/thanos-io/thanos/pkg/extprom" extpromhttp "github.com/thanos-io/thanos/pkg/extprom/http" @@ -150,7 +150,19 @@ func registerQueryFrontend(app *extkingpin.App) { } func parseTransportConfiguration(downstreamTripperConfContentYaml []byte) (*http.Transport, error) { - downstreamTripper := exthttp.NewTransport() + downstreamTripper := &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + ForceAttemptHTTP2: true, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + } if len(downstreamTripperConfContentYaml) > 0 { tripperConfig := &queryfrontend.DownstreamTripperConfig{} diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index 1828310f09..aabecf76b6 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -29,6 +29,7 @@ type TLSConfig struct { InsecureSkipVerify bool `yaml:"insecure_skip_verify"` } +// TODO(bwplotka): Comment. type HTTPConfig struct { IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` @@ -47,23 +48,6 @@ type HTTPConfig struct { DisableCompression bool } -// NewTransport creates a new http.Transport with default settings. -func NewTransport() *http.Transport { - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - ForceAttemptHTTP2: true, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - } -} - // DefaultTransport - this default transport is based on the Minio // DefaultTransport up until the following commit: // https://github.com/minio/minio-go/commit/008c7aa71fc17e11bf980c209a4f8c4d687fc884 @@ -73,8 +57,7 @@ func DefaultTransport(config HTTPConfig) (*http.Transport, error) { if err != nil { return nil, err } - - config.InsecureSkipVerify = tlsConfig.InsecureSkipVerify + tlsConfig.InsecureSkipVerify = config.InsecureSkipVerify return &http.Transport{ Proxy: http.ProxyFromEnvironment, @@ -122,12 +105,17 @@ func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) { if len(cfg.ServerName) > 0 { tlsConfig.ServerName = cfg.ServerName } + // If a client cert & key is provided then configure TLS config accordingly. if len(cfg.CertFile) > 0 && len(cfg.KeyFile) == 0 { return nil, fmt.Errorf("client cert file %q specified without client key file", cfg.CertFile) - } else if len(cfg.KeyFile) > 0 && len(cfg.CertFile) == 0 { + } + + if len(cfg.KeyFile) > 0 && len(cfg.CertFile) == 0 { return nil, fmt.Errorf("client key file %q specified without client cert file", cfg.KeyFile) - } else if len(cfg.CertFile) > 0 && len(cfg.KeyFile) > 0 { + } + + if len(cfg.CertFile) > 0 && len(cfg.KeyFile) > 0 { // Verify that client cert and key are valid. if _, err := cfg.getClientCertificate(nil); err != nil { return nil, err diff --git a/pkg/objstore/azure/azure.go b/pkg/objstore/azure/azure.go index 07e316c9f4..44530450c4 100644 --- a/pkg/objstore/azure/azure.go +++ b/pkg/objstore/azure/azure.go @@ -8,7 +8,6 @@ import ( "context" "io" "io/ioutil" - "net/http" "os" "strings" "testing" @@ -29,18 +28,9 @@ const ( azureDefaultEndpoint = "blob.core.windows.net" ) -// Set default retry values to default Azure values. 0 = use Default Azure. +// DefaultConfig for Azure objstore client. var DefaultConfig = Config{ - PipelineConfig: PipelineConfig{ - MaxTries: 0, - TryTimeout: 0, - RetryDelay: 0, - MaxRetryDelay: 0, - }, - ReaderConfig: ReaderConfig{ - MaxRetryRequests: 0, - }, - HTTPConfig: HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -54,16 +44,16 @@ var DefaultConfig = Config{ // Config Azure storage configuration. type Config struct { - StorageAccountName string `yaml:"storage_account"` - StorageAccountKey string `yaml:"storage_account_key"` - ContainerName string `yaml:"container"` - Endpoint string `yaml:"endpoint"` - MaxRetries int `yaml:"max_retries"` - MSIResource string `yaml:"msi_resource"` - UserAssignedID string `yaml:"user_assigned_id"` - PipelineConfig PipelineConfig `yaml:"pipeline_config"` - ReaderConfig ReaderConfig `yaml:"reader_config"` - HTTPConfig HTTPConfig `yaml:"http_config"` + StorageAccountName string `yaml:"storage_account"` + StorageAccountKey string `yaml:"storage_account_key"` + ContainerName string `yaml:"container"` + Endpoint string `yaml:"endpoint"` + MaxRetries int `yaml:"max_retries"` + MSIResource string `yaml:"msi_resource"` + UserAssignedID string `yaml:"user_assigned_id"` + PipelineConfig PipelineConfig `yaml:"pipeline_config"` + ReaderConfig ReaderConfig `yaml:"reader_config"` + HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` } type ReaderConfig struct { @@ -139,23 +129,10 @@ func (conf *Config) validate() error { return nil } -type HTTPConfig struct { - IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` - ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` - InsecureSkipVerify bool `yaml:"insecure_skip_verify"` - - TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` - ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` - MaxIdleConns int `yaml:"max_idle_conns"` - MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` - MaxConnsPerHost int `yaml:"max_conns_per_host"` - - // Transport field allows upstream callers to inject a custom round tripper. - Transport http.RoundTripper `yaml:"-"` - - TLSConfig exthttp.TLSConfig `yaml:"tls_config"` - DisableCompression bool -} +// HTTPConfig exists here only because Cortex depends on it, and we depend on Cortex. +// Deprecated. +// TODO(bwplotka): Remove it, once we remove Cortex cycle dep, or Cortex stops using this. +type HTTPConfig = exthttp.HTTPConfig // parseConfig unmarshals a buffer into a Config with default values. func parseConfig(conf []byte) (Config, error) { diff --git a/pkg/objstore/azure/azure_test.go b/pkg/objstore/azure/azure_test.go index 41a61430ee..fcf51e0a10 100644 --- a/pkg/objstore/azure/azure_test.go +++ b/pkg/objstore/azure/azure_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -235,7 +236,7 @@ http_config: `) cfg, err := parseConfig(input) testutil.Ok(t, err) - transport, err := DefaultTransport(cfg.HTTPConfig) + transport, err := exthttp.DefaultTransport(cfg.HTTPConfig) testutil.Ok(t, err) testutil.Equals(t, true, transport.TLSClientConfig.InsecureSkipVerify) } diff --git a/pkg/objstore/azure/helpers.go b/pkg/objstore/azure/helpers.go index 8642bb11bd..cebcd27dd4 100644 --- a/pkg/objstore/azure/helpers.go +++ b/pkg/objstore/azure/helpers.go @@ -6,8 +6,6 @@ package azure import ( "context" "fmt" - - "net" "net/http" "net/url" "regexp" @@ -87,42 +85,6 @@ func getServicePrincipalToken(logger log.Logger, conf Config) (*adal.ServicePrin return msiConfig.ServicePrincipalToken() } -func DefaultTransport(config HTTPConfig) (*http.Transport, error) { - tlsConfig, err := exthttp.NewTLSConfig(&config.TLSConfig) - if err != nil { - return nil, err - } - - config.InsecureSkipVerify = tlsConfig.InsecureSkipVerify - - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - - MaxIdleConns: config.MaxIdleConns, - MaxIdleConnsPerHost: config.MaxIdleConnsPerHost, - IdleConnTimeout: time.Duration(config.IdleConnTimeout), - MaxConnsPerHost: config.MaxConnsPerHost, - TLSHandshakeTimeout: time.Duration(config.TLSHandshakeTimeout), - ExpectContinueTimeout: time.Duration(config.ExpectContinueTimeout), - // A custom ResponseHeaderTimeout was introduced - // to cover cases where the tcp connection works but - // the server never answers. Defaults to 2 minutes. - ResponseHeaderTimeout: time.Duration(config.ResponseHeaderTimeout), - // Set this value so that the underlying transport round-tripper - // doesn't try to auto decode the body of objects with - // content-encoding set to `gzip`. - // - // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. - DisableCompression: true, - TLSClientConfig: tlsConfig, - }, nil -} - func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob.ContainerURL, error) { credentials, err := getAzureStorageCredentials(logger, conf) @@ -141,7 +103,7 @@ func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob. retryOptions.TryTimeout = time.Until(deadline) } - dt, err := DefaultTransport(conf.HTTPConfig) + dt, err := exthttp.DefaultTransport(conf.HTTPConfig) if err != nil { return blob.ContainerURL{}, err } diff --git a/pkg/objstore/s3/s3.go b/pkg/objstore/s3/s3.go index 994db8391f..e8b0f80dea 100644 --- a/pkg/objstore/s3/s3.go +++ b/pkg/objstore/s3/s3.go @@ -9,7 +9,6 @@ import ( "fmt" "io" "io/ioutil" - "net" "net/http" "os" "runtime" @@ -26,12 +25,10 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/model" "github.com/prometheus/common/version" - "gopkg.in/yaml.v2" - "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/objstore" - "github.com/thanos-io/thanos/pkg/runutil" + "gopkg.in/yaml.v2" ) type ctxKey int @@ -102,7 +99,7 @@ const ( var DefaultConfig = Config{ PutUserMetadata: map[string]string{}, - HTTPConfig: HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ IdleConnTimeout: model.Duration(90 * time.Second), ResponseHeaderTimeout: model.Duration(2 * time.Minute), TLSHandshakeTimeout: model.Duration(10 * time.Second), @@ -115,39 +112,26 @@ var DefaultConfig = Config{ BucketLookupType: AutoLookup, } -type HTTPConfig struct { - IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` - ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` - InsecureSkipVerify bool `yaml:"insecure_skip_verify"` - - TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` - ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` - MaxIdleConns int `yaml:"max_idle_conns"` - MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` - MaxConnsPerHost int `yaml:"max_conns_per_host"` - - // Transport field allows upstream callers to inject a custom round tripper. - Transport http.RoundTripper `yaml:"-"` - - TLSConfig exthttp.TLSConfig `yaml:"tls_config"` - DisableCompression bool -} +// HTTPConfig exists here only because Cortex depends on it, and we depend on Cortex. +// Deprecated. +// TODO(bwplotka): Remove it, once we remove Cortex cycle dep, or Cortex stops using this. +type HTTPConfig = exthttp.HTTPConfig // Config stores the configuration for s3 bucket. type Config struct { - Bucket string `yaml:"bucket"` - Endpoint string `yaml:"endpoint"` - Region string `yaml:"region"` - AWSSDKAuth bool `yaml:"aws_sdk_auth"` - AccessKey string `yaml:"access_key"` - Insecure bool `yaml:"insecure"` - SignatureV2 bool `yaml:"signature_version2"` - SecretKey string `yaml:"secret_key"` - PutUserMetadata map[string]string `yaml:"put_user_metadata"` - HTTPConfig HTTPConfig `yaml:"http_config"` - TraceConfig TraceConfig `yaml:"trace"` - ListObjectsVersion string `yaml:"list_objects_version"` - BucketLookupType BucketLookupType `yaml:"bucket_lookup_type"` + Bucket string `yaml:"bucket"` + Endpoint string `yaml:"endpoint"` + Region string `yaml:"region"` + AWSSDKAuth bool `yaml:"aws_sdk_auth"` + AccessKey string `yaml:"access_key"` + Insecure bool `yaml:"insecure"` + SignatureV2 bool `yaml:"signature_version2"` + SecretKey string `yaml:"secret_key"` + PutUserMetadata map[string]string `yaml:"put_user_metadata"` + HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` + TraceConfig TraceConfig `yaml:"trace"` + ListObjectsVersion string `yaml:"list_objects_version"` + BucketLookupType BucketLookupType `yaml:"bucket_lookup_type"` // PartSize used for multipart upload. Only used if uploaded object size is known and larger than configured PartSize. // NOTE we need to make sure this number does not produce more parts than 10 000. PartSize uint64 `yaml:"part_size"` @@ -179,43 +163,7 @@ type Bucket struct { listObjectsV1 bool } -func DefaultTransport(config HTTPConfig) (*http.Transport, error) { - tlsConfig, err := exthttp.NewTLSConfig(&config.TLSConfig) - if err != nil { - return nil, err - } - - config.InsecureSkipVerify = tlsConfig.InsecureSkipVerify - - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - - MaxIdleConns: config.MaxIdleConns, - MaxIdleConnsPerHost: config.MaxIdleConnsPerHost, - IdleConnTimeout: time.Duration(config.IdleConnTimeout), - MaxConnsPerHost: config.MaxConnsPerHost, - TLSHandshakeTimeout: time.Duration(config.TLSHandshakeTimeout), - ExpectContinueTimeout: time.Duration(config.ExpectContinueTimeout), - // A custom ResponseHeaderTimeout was introduced - // to cover cases where the tcp connection works but - // the server never answers. Defaults to 2 minutes. - ResponseHeaderTimeout: time.Duration(config.ResponseHeaderTimeout), - // Set this value so that the underlying transport round-tripper - // doesn't try to auto decode the body of objects with - // content-encoding set to `gzip`. - // - // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. - DisableCompression: true, - TLSClientConfig: tlsConfig, - }, nil -} - -// parseConfig unmarshals a buffer into a Config with default HTTPConfig values. +// parseConfig unmarshals a buffer into a Config with default values. func parseConfig(conf []byte) (Config, error) { config := DefaultConfig if err := yaml.UnmarshalStrict(conf, &config); err != nil { @@ -299,7 +247,7 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B rt = config.HTTPConfig.Transport } else { var err error - rt, err = DefaultTransport(config.HTTPConfig) + rt, err = exthttp.DefaultTransport(config.HTTPConfig) if err != nil { return nil, err } diff --git a/pkg/objstore/s3/s3_test.go b/pkg/objstore/s3/s3_test.go index f70db95f11..d9734ccf83 100644 --- a/pkg/objstore/s3/s3_test.go +++ b/pkg/objstore/s3/s3_test.go @@ -16,6 +16,7 @@ import ( "github.com/go-kit/log" "github.com/minio/minio-go/v7/pkg/encrypt" + "github.com/thanos-io/thanos/pkg/exthttp" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -198,7 +199,7 @@ http_config: `) cfg, err := parseConfig(input) testutil.Ok(t, err) - transport, err := DefaultTransport(cfg.HTTPConfig) + transport, err := exthttp.DefaultTransport(cfg.HTTPConfig) testutil.Ok(t, err) testutil.Equals(t, true, transport.TLSClientConfig.InsecureSkipVerify) } diff --git a/test/e2e/e2ethanos/services.go b/test/e2e/e2ethanos/services.go index 0d01cc1618..88868dc3b7 100644 --- a/test/e2e/e2ethanos/services.go +++ b/test/e2e/e2ethanos/services.go @@ -973,7 +973,7 @@ func NewS3Config(bucket, endpoint, basePath string) s3.Config { SecretKey: e2edb.MinioSecretKey, Endpoint: endpoint, Insecure: false, - HTTPConfig: s3.HTTPConfig{ + HTTPConfig: exthttp.HTTPConfig{ TLSConfig: exthttp.TLSConfig{ CAFile: filepath.Join(basePath, "certs", "CAs", "ca.crt"), CertFile: filepath.Join(basePath, "certs", "public.crt"), From cd81174ed53ccc824df2f978e68f7e4b979081fa Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Thu, 30 Jun 2022 19:31:12 +0530 Subject: [PATCH 12/18] Created a new tlsconfig in exthttp and minor changes in cos.go Signed-off-by: Srushti Sapkale --- pkg/exthttp/tlsconfig.go | 73 ++++++++++++++++++++++++++++++++++++++++ pkg/exthttp/transport.go | 71 -------------------------------------- pkg/objstore/cos/cos.go | 2 +- 3 files changed, 74 insertions(+), 72 deletions(-) create mode 100644 pkg/exthttp/tlsconfig.go diff --git a/pkg/exthttp/tlsconfig.go b/pkg/exthttp/tlsconfig.go new file mode 100644 index 0000000000..b4abf73809 --- /dev/null +++ b/pkg/exthttp/tlsconfig.go @@ -0,0 +1,73 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package exthttp + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "io/ioutil" +) + +// NewTLSConfig creates a new tls.Config from the given TLSConfig. +func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) { + tlsConfig := &tls.Config{InsecureSkipVerify: cfg.InsecureSkipVerify} + + // If a CA cert is provided then let's read it in. + if len(cfg.CAFile) > 0 { + b, err := readCAFile(cfg.CAFile) + if err != nil { + return nil, err + } + if !updateRootCA(tlsConfig, b) { + return nil, fmt.Errorf("unable to use specified CA cert %s", cfg.CAFile) + } + } + + if len(cfg.ServerName) > 0 { + tlsConfig.ServerName = cfg.ServerName + } + // If a client cert & key is provided then configure TLS config accordingly. + if len(cfg.CertFile) > 0 && len(cfg.KeyFile) == 0 { + return nil, fmt.Errorf("client cert file %q specified without client key file", cfg.CertFile) + } else if len(cfg.KeyFile) > 0 && len(cfg.CertFile) == 0 { + return nil, fmt.Errorf("client key file %q specified without client cert file", cfg.KeyFile) + } else if len(cfg.CertFile) > 0 && len(cfg.KeyFile) > 0 { + // Verify that client cert and key are valid. + if _, err := cfg.getClientCertificate(nil); err != nil { + return nil, err + } + tlsConfig.GetClientCertificate = cfg.getClientCertificate + } + + return tlsConfig, nil +} + +// readCAFile reads the CA cert file from disk. +func readCAFile(f string) ([]byte, error) { + data, err := ioutil.ReadFile(f) + if err != nil { + return nil, fmt.Errorf("unable to load specified CA cert %s: %s", f, err) + } + return data, nil +} + +// updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs. +func updateRootCA(cfg *tls.Config, b []byte) bool { + caCertPool := x509.NewCertPool() + if !caCertPool.AppendCertsFromPEM(b) { + return false + } + cfg.RootCAs = caCertPool + return true +} + +// getClientCertificate reads the pair of client cert and key from disk and returns a tls.Certificate. +func (c *TLSConfig) getClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error) { + cert, err := tls.LoadX509KeyPair(c.CertFile, c.KeyFile) + if err != nil { + return nil, fmt.Errorf("unable to use specified client cert (%s) & key (%s): %s", c.CertFile, c.KeyFile, err) + } + return &cert, nil +} diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index aabecf76b6..288957c312 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -4,10 +4,6 @@ package exthttp import ( - "crypto/tls" - "crypto/x509" - "fmt" - "io/ioutil" "net" "net/http" "time" @@ -86,70 +82,3 @@ func DefaultTransport(config HTTPConfig) (*http.Transport, error) { TLSClientConfig: tlsConfig, }, nil } - -// NewTLSConfig creates a new tls.Config from the given TLSConfig. -func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) { - tlsConfig := &tls.Config{InsecureSkipVerify: cfg.InsecureSkipVerify} - - // If a CA cert is provided then let's read it in. - if len(cfg.CAFile) > 0 { - b, err := readCAFile(cfg.CAFile) - if err != nil { - return nil, err - } - if !updateRootCA(tlsConfig, b) { - return nil, fmt.Errorf("unable to use specified CA cert %s", cfg.CAFile) - } - } - - if len(cfg.ServerName) > 0 { - tlsConfig.ServerName = cfg.ServerName - } - - // If a client cert & key is provided then configure TLS config accordingly. - if len(cfg.CertFile) > 0 && len(cfg.KeyFile) == 0 { - return nil, fmt.Errorf("client cert file %q specified without client key file", cfg.CertFile) - } - - if len(cfg.KeyFile) > 0 && len(cfg.CertFile) == 0 { - return nil, fmt.Errorf("client key file %q specified without client cert file", cfg.KeyFile) - } - - if len(cfg.CertFile) > 0 && len(cfg.KeyFile) > 0 { - // Verify that client cert and key are valid. - if _, err := cfg.getClientCertificate(nil); err != nil { - return nil, err - } - tlsConfig.GetClientCertificate = cfg.getClientCertificate - } - - return tlsConfig, nil -} - -// readCAFile reads the CA cert file from disk. -func readCAFile(f string) ([]byte, error) { - data, err := ioutil.ReadFile(f) - if err != nil { - return nil, fmt.Errorf("unable to load specified CA cert %s: %s", f, err) - } - return data, nil -} - -// updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs. -func updateRootCA(cfg *tls.Config, b []byte) bool { - caCertPool := x509.NewCertPool() - if !caCertPool.AppendCertsFromPEM(b) { - return false - } - cfg.RootCAs = caCertPool - return true -} - -// getClientCertificate reads the pair of client cert and key from disk and returns a tls.Certificate. -func (c *TLSConfig) getClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error) { - cert, err := tls.LoadX509KeyPair(c.CertFile, c.KeyFile) - if err != nil { - return nil, fmt.Errorf("unable to use specified client cert (%s) & key (%s): %s", c.CertFile, c.KeyFile, err) - } - return &cert, nil -} diff --git a/pkg/objstore/cos/cos.go b/pkg/objstore/cos/cos.go index b97f204552..931c8fde10 100644 --- a/pkg/objstore/cos/cos.go +++ b/pkg/objstore/cos/cos.go @@ -136,7 +136,7 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B bucketURL = cos.NewBucketURL(fmt.Sprintf("%s-%s", config.Bucket, config.AppId), config.Region, true) } b := &cos.BaseURL{BucketURL: bucketURL} - tpt, err := exthttp.DefaultTransport(config.HTTPConfig) + tpt, _ := exthttp.DefaultTransport(config.HTTPConfig) client := cos.NewClient(b, &http.Client{ Transport: &cos.AuthorizationTransport{ SecretID: config.SecretId, From 79460cb4c79e9dc2e534f13efc7f7110c8ef1413 Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Thu, 30 Jun 2022 19:48:54 +0530 Subject: [PATCH 13/18] Commented in s3.go Signed-off-by: Srushti Sapkale --- pkg/exthttp/transport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index 288957c312..c421c0b740 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -25,7 +25,7 @@ type TLSConfig struct { InsecureSkipVerify bool `yaml:"insecure_skip_verify"` } -// TODO(bwplotka): Comment. +// TODO(bwplotka): HTTPConfig stores the http.Transport configuration for the cos and s3 minio client. type HTTPConfig struct { IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` From 878994761fe903129647e528aa2f17badba33769 Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Thu, 30 Jun 2022 21:27:52 +0530 Subject: [PATCH 14/18] Minor changes in transport.go Signed-off-by: Srushti Sapkale --- docs/storage.md | 11 ++++++++++- pkg/exthttp/transport.go | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/storage.md b/docs/storage.md index b2f0316537..23529200df 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -86,6 +86,7 @@ config: key_file: "" server_name: "" insecure_skip_verify: false + disable_compression: false trace: enable: false list_objects_version: "" @@ -356,13 +357,13 @@ config: max_idle_conns: 0 max_idle_conns_per_host: 0 max_conns_per_host: 0 - disable_compression: false tls_config: ca_file: "" cert_file: "" key_file: "" server_name: "" insecure_skip_verify: false + disable_compression: false prefix: "" ``` @@ -425,11 +426,19 @@ config: http_config: idle_conn_timeout: 1m30s response_header_timeout: 2m + insecure_skip_verify: false tls_handshake_timeout: 10s expect_continue_timeout: 1s max_idle_conns: 100 max_idle_conns_per_host: 100 max_conns_per_host: 0 + tls_config: + ca_file: "" + cert_file: "" + key_file: "" + server_name: "" + insecure_skip_verify: false + disable_compression: false prefix: "" ``` diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index c421c0b740..4e0b707341 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -41,7 +41,7 @@ type HTTPConfig struct { Transport http.RoundTripper `yaml:"-"` TLSConfig TLSConfig `yaml:"tls_config"` - DisableCompression bool + DisableCompression bool `yaml:"disable_compression"` } // DefaultTransport - this default transport is based on the Minio From 195925f32e5b8c92c98b2ff2e5eaf4185d6a0b7d Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Fri, 1 Jul 2022 16:43:39 +0530 Subject: [PATCH 15/18] Changed transport.go Signed-off-by: Srushti Sapkale --- .bingo/prometheus.mod | 41 +++++++++++++++++++++++++++++++- .bingo/prometheus.sum | 51 ++++++++++++++++++++++++++++++++++++++++ docs/storage.md | 11 ++++++++- pkg/exthttp/transport.go | 5 ++-- 4 files changed, 103 insertions(+), 5 deletions(-) diff --git a/.bingo/prometheus.mod b/.bingo/prometheus.mod index 5e496c7de9..e8f1e3e61c 100644 --- a/.bingo/prometheus.mod +++ b/.bingo/prometheus.mod @@ -20,4 +20,43 @@ replace ( k8s.io/klog => github.com/simonpasquier/klog-gokit v0.1.0 ) -require github.com/prometheus/prometheus v2.4.3+incompatible // cmd/prometheus +require ( + github.com/Azure/azure-sdk-for-go v0.0.0-00010101000000-000000000000 // indirect + github.com/Azure/go-autorest v0.0.0-00010101000000-000000000000 // indirect + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect + github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/aws/aws-sdk-go v1.44.46 // indirect + github.com/cockroachdb/cmux v0.0.0-00010101000000-000000000000 // indirect + github.com/cockroachdb/cockroach v0.0.0-00010101000000-000000000000 // indirect + github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect + github.com/go-kit/kit v0.12.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/googleapis/gnostic v0.0.0-00010101000000-000000000000 // indirect + github.com/gophercloud/gophercloud v0.0.0-00010101000000-000000000000 // indirect + github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect + github.com/hashicorp/consul/api v1.13.0 // indirect + github.com/jpillora/backoff v1.0.0 // indirect + github.com/julienschmidt/httprouter v1.3.0 // indirect + github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect + github.com/oklog/oklog v0.3.2 // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect + github.com/peterbourgon/diskv v2.0.1+incompatible // indirect + github.com/prometheus/prometheus v2.4.3+incompatible // cmd/prometheus + github.com/prometheus/tsdb v0.0.0-00010101000000-000000000000 // indirect + github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414 // indirect + github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect + github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect + golang.org/x/net v0.0.0-20220630215102-69896b714898 // indirect + golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 // indirect + golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect + google.golang.org/api v0.86.0 // indirect + google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7 // indirect + gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect + gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.0.0-00010101000000-000000000000 // indirect + k8s.io/apimachinery v0.0.0-00010101000000-000000000000 // indirect + k8s.io/client-go v0.0.0-00010101000000-000000000000 // indirect +) diff --git a/.bingo/prometheus.sum b/.bingo/prometheus.sum index a7abd5640e..0179283da7 100644 --- a/.bingo/prometheus.sum +++ b/.bingo/prometheus.sum @@ -28,6 +28,8 @@ cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Ud cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2 h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0 h1:DAq3r8y4mDgyB/ZPJ9v/5VJNqjgJAxTn6ZYLlUywOu8= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -40,8 +42,11 @@ cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6m cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1 h1:2sMmt8prCn7DPaG4Pmh0N3Inmc8cT8ae5k1M6VJ9Wqc= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -51,6 +56,7 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v5.0.0-beta.0.20161028183111-bd73d950fa44+incompatible h1:+5hx+ZckahrubYyxbjTwnq9w5xpnq1CwSL4N54I8/qc= github.com/Azure/azure-sdk-for-go v5.0.0-beta.0.20161028183111-bd73d950fa44+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -82,6 +88,8 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.44.20 h1:nllTRN24EfhDSeKsNbIc6HoC8Ogd2NCJTRB8l84kDlM= github.com/aws/aws-sdk-go v1.44.20/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.46 h1:BsKENvu24eXg7CWQ2wJAjKbDFkGP+hBtxKJIR3UdcB8= +github.com/aws/aws-sdk-go v1.44.46/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= @@ -243,6 +251,11 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -250,8 +263,11 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0 h1:nRJtk3y8Fm770D42QV6T90ZnvFZyk7agSo3Q+Z9p3WI= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gnostic v0.2.3-0.20180520015035-48a0ecefe2e4 h1:Z09Qt6AGDtg0cC/YgnX/iymzIqmZf5aasP5JZFxmkNQ= github.com/googleapis/gnostic v0.2.3-0.20180520015035-48a0ecefe2e4/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gophercloud/gophercloud v0.18.0 h1:V6hcuMPmjXg+js9flU8T3RIHDCjV7F5CG5GD0MRhP/w= github.com/gophercloud/gophercloud v0.18.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -265,6 +281,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= +github.com/hashicorp/consul/api v1.13.0 h1:2hnLQ0GjQvw7f3O61jMO8gbasZviZTrt9R8WzgiirHc= +github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -571,6 +589,10 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220630215102-69896b714898 h1:K7wO6V1IrczY9QOQ2WkVpw4JQSwCd52UsxVEirZUfiw= +golang.org/x/net v0.0.0-20220630215102-69896b714898/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -591,6 +613,10 @@ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 h1:VnGaRqoLmqZH/3TMLJwYCEWkR4j1nuIU1U9TvbqsDUw= +golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -603,6 +629,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -673,8 +701,13 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= @@ -696,6 +729,8 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220411224347-583f2d630306 h1:+gHMid33q6pen7kv9xvT+JRinntgeXO2AeZVd0AWD3w= golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= +golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -758,6 +793,8 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -798,8 +835,12 @@ google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/S google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0 h1:IQWaGVCYnsm4MO3hh+WtSXMzMzuyFx/fuR8qkN3A0Qo= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.86.0 h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U= +google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -846,6 +887,7 @@ google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -879,9 +921,16 @@ google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220523171625-347a074981d8 h1:4NSrVrQGh6+UqBEd+Kwdh6ZDwESH0Sj2bNUQN+VjoQk= google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7 h1:q4zUJDd0+knPFB9x20S3vnxzlYNBbt8Yd7zBMVMteeM= +google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -913,6 +962,8 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/docs/storage.md b/docs/storage.md index b2f0316537..23529200df 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -86,6 +86,7 @@ config: key_file: "" server_name: "" insecure_skip_verify: false + disable_compression: false trace: enable: false list_objects_version: "" @@ -356,13 +357,13 @@ config: max_idle_conns: 0 max_idle_conns_per_host: 0 max_conns_per_host: 0 - disable_compression: false tls_config: ca_file: "" cert_file: "" key_file: "" server_name: "" insecure_skip_verify: false + disable_compression: false prefix: "" ``` @@ -425,11 +426,19 @@ config: http_config: idle_conn_timeout: 1m30s response_header_timeout: 2m + insecure_skip_verify: false tls_handshake_timeout: 10s expect_continue_timeout: 1s max_idle_conns: 100 max_idle_conns_per_host: 100 max_conns_per_host: 0 + tls_config: + ca_file: "" + cert_file: "" + key_file: "" + server_name: "" + insecure_skip_verify: false + disable_compression: false prefix: "" ``` diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index c421c0b740..857685b14b 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -41,7 +41,7 @@ type HTTPConfig struct { Transport http.RoundTripper `yaml:"-"` TLSConfig TLSConfig `yaml:"tls_config"` - DisableCompression bool + DisableCompression bool `yaml:"disable_compression"` } // DefaultTransport - this default transport is based on the Minio @@ -78,7 +78,6 @@ func DefaultTransport(config HTTPConfig) (*http.Transport, error) { // content-encoding set to `gzip`. // // Refer: https://golang.org/src/net/http/transport.go?h=roundTrip#L1843. - DisableCompression: true, - TLSClientConfig: tlsConfig, + TLSClientConfig: tlsConfig, }, nil } From d66d816b3e886c5bc70f77b2cd834bfc596b03bf Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Mon, 4 Jul 2022 13:38:11 +0530 Subject: [PATCH 16/18] Changed transport.go and tlsconfig.go Signed-off-by: Srushti Sapkale --- pkg/exthttp/tlsconfig.go | 14 ++++++++++++++ pkg/exthttp/transport.go | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/exthttp/tlsconfig.go b/pkg/exthttp/tlsconfig.go index b4abf73809..d1315ad285 100644 --- a/pkg/exthttp/tlsconfig.go +++ b/pkg/exthttp/tlsconfig.go @@ -10,6 +10,20 @@ import ( "io/ioutil" ) +// TLSConfig configures the options for TLS connections. +type TLSConfig struct { + // The CA cert to use for the targets. + CAFile string `yaml:"ca_file"` + // The client cert file for the targets. + CertFile string `yaml:"cert_file"` + // The client key file for the targets. + KeyFile string `yaml:"key_file"` + // Used to verify the hostname for the targets. + ServerName string `yaml:"server_name"` + // Disable target certificate validation. + InsecureSkipVerify bool `yaml:"insecure_skip_verify"` +} + // NewTLSConfig creates a new tls.Config from the given TLSConfig. func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) { tlsConfig := &tls.Config{InsecureSkipVerify: cfg.InsecureSkipVerify} diff --git a/pkg/exthttp/transport.go b/pkg/exthttp/transport.go index 857685b14b..76d6ee70d4 100644 --- a/pkg/exthttp/transport.go +++ b/pkg/exthttp/transport.go @@ -11,20 +11,6 @@ import ( "github.com/prometheus/common/model" ) -// TLSConfig configures the options for TLS connections. -type TLSConfig struct { - // The CA cert to use for the targets. - CAFile string `yaml:"ca_file"` - // The client cert file for the targets. - CertFile string `yaml:"cert_file"` - // The client key file for the targets. - KeyFile string `yaml:"key_file"` - // Used to verify the hostname for the targets. - ServerName string `yaml:"server_name"` - // Disable target certificate validation. - InsecureSkipVerify bool `yaml:"insecure_skip_verify"` -} - // TODO(bwplotka): HTTPConfig stores the http.Transport configuration for the cos and s3 minio client. type HTTPConfig struct { IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` From 04cb13f57a021e43942ff1f79c093ab260dbfb9d Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Mon, 4 Jul 2022 13:48:51 +0530 Subject: [PATCH 17/18] Removed changes from prometheus.mod and prometheus.sum Signed-off-by: Srushti Sapkale --- .bingo/prometheus.mod | 41 +--------------------------------- .bingo/prometheus.sum | 51 ------------------------------------------- 2 files changed, 1 insertion(+), 91 deletions(-) diff --git a/.bingo/prometheus.mod b/.bingo/prometheus.mod index e8f1e3e61c..5e496c7de9 100644 --- a/.bingo/prometheus.mod +++ b/.bingo/prometheus.mod @@ -20,43 +20,4 @@ replace ( k8s.io/klog => github.com/simonpasquier/klog-gokit v0.1.0 ) -require ( - github.com/Azure/azure-sdk-for-go v0.0.0-00010101000000-000000000000 // indirect - github.com/Azure/go-autorest v0.0.0-00010101000000-000000000000 // indirect - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect - github.com/aws/aws-sdk-go v1.44.46 // indirect - github.com/cockroachdb/cmux v0.0.0-00010101000000-000000000000 // indirect - github.com/cockroachdb/cockroach v0.0.0-00010101000000-000000000000 // indirect - github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect - github.com/go-kit/kit v0.12.0 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/googleapis/gnostic v0.0.0-00010101000000-000000000000 // indirect - github.com/gophercloud/gophercloud v0.0.0-00010101000000-000000000000 // indirect - github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect - github.com/hashicorp/consul/api v1.13.0 // indirect - github.com/jpillora/backoff v1.0.0 // indirect - github.com/julienschmidt/httprouter v1.3.0 // indirect - github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect - github.com/oklog/oklog v0.3.2 // indirect - github.com/oklog/run v1.1.0 // indirect - github.com/oklog/ulid v1.3.1 // indirect - github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect - github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/prometheus/prometheus v2.4.3+incompatible // cmd/prometheus - github.com/prometheus/tsdb v0.0.0-00010101000000-000000000000 // indirect - github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414 // indirect - github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect - github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect - golang.org/x/net v0.0.0-20220630215102-69896b714898 // indirect - golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 // indirect - golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - google.golang.org/api v0.86.0 // indirect - google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7 // indirect - gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect - gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - k8s.io/api v0.0.0-00010101000000-000000000000 // indirect - k8s.io/apimachinery v0.0.0-00010101000000-000000000000 // indirect - k8s.io/client-go v0.0.0-00010101000000-000000000000 // indirect -) +require github.com/prometheus/prometheus v2.4.3+incompatible // cmd/prometheus diff --git a/.bingo/prometheus.sum b/.bingo/prometheus.sum index 0179283da7..a7abd5640e 100644 --- a/.bingo/prometheus.sum +++ b/.bingo/prometheus.sum @@ -28,8 +28,6 @@ cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Ud cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2 h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0 h1:DAq3r8y4mDgyB/ZPJ9v/5VJNqjgJAxTn6ZYLlUywOu8= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -42,11 +40,8 @@ cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6m cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1 h1:2sMmt8prCn7DPaG4Pmh0N3Inmc8cT8ae5k1M6VJ9Wqc= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -56,7 +51,6 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v5.0.0-beta.0.20161028183111-bd73d950fa44+incompatible h1:+5hx+ZckahrubYyxbjTwnq9w5xpnq1CwSL4N54I8/qc= github.com/Azure/azure-sdk-for-go v5.0.0-beta.0.20161028183111-bd73d950fa44+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -88,8 +82,6 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.44.20 h1:nllTRN24EfhDSeKsNbIc6HoC8Ogd2NCJTRB8l84kDlM= github.com/aws/aws-sdk-go v1.44.20/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.46 h1:BsKENvu24eXg7CWQ2wJAjKbDFkGP+hBtxKJIR3UdcB8= -github.com/aws/aws-sdk-go v1.44.46/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= @@ -251,11 +243,6 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -263,11 +250,8 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0 h1:nRJtk3y8Fm770D42QV6T90ZnvFZyk7agSo3Q+Z9p3WI= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gnostic v0.2.3-0.20180520015035-48a0ecefe2e4 h1:Z09Qt6AGDtg0cC/YgnX/iymzIqmZf5aasP5JZFxmkNQ= github.com/googleapis/gnostic v0.2.3-0.20180520015035-48a0ecefe2e4/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gophercloud/gophercloud v0.18.0 h1:V6hcuMPmjXg+js9flU8T3RIHDCjV7F5CG5GD0MRhP/w= github.com/gophercloud/gophercloud v0.18.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -281,8 +265,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/api v1.13.0 h1:2hnLQ0GjQvw7f3O61jMO8gbasZviZTrt9R8WzgiirHc= -github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -589,10 +571,6 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220630215102-69896b714898 h1:K7wO6V1IrczY9QOQ2WkVpw4JQSwCd52UsxVEirZUfiw= -golang.org/x/net v0.0.0-20220630215102-69896b714898/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -613,10 +591,6 @@ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 h1:VnGaRqoLmqZH/3TMLJwYCEWkR4j1nuIU1U9TvbqsDUw= -golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -629,8 +603,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -701,13 +673,8 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= @@ -729,8 +696,6 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220411224347-583f2d630306 h1:+gHMid33q6pen7kv9xvT+JRinntgeXO2AeZVd0AWD3w= golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -793,8 +758,6 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -835,12 +798,8 @@ google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/S google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0 h1:IQWaGVCYnsm4MO3hh+WtSXMzMzuyFx/fuR8qkN3A0Qo= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.86.0 h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U= -google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -887,7 +846,6 @@ google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -921,16 +879,9 @@ google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220523171625-347a074981d8 h1:4NSrVrQGh6+UqBEd+Kwdh6ZDwESH0Sj2bNUQN+VjoQk= google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7 h1:q4zUJDd0+knPFB9x20S3vnxzlYNBbt8Yd7zBMVMteeM= -google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -962,8 +913,6 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From a95172b472623f41120cbd5efa7da655df178a40 Mon Sep 17 00:00:00 2001 From: Srushti Sapkale Date: Mon, 4 Jul 2022 19:08:38 +0530 Subject: [PATCH 18/18] Minor updation in cos.go Signed-off-by: Srushti Sapkale --- pkg/objstore/cos/cos.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkg/objstore/cos/cos.go b/pkg/objstore/cos/cos.go index 931c8fde10..a22010bb72 100644 --- a/pkg/objstore/cos/cos.go +++ b/pkg/objstore/cos/cos.go @@ -94,17 +94,6 @@ func parseConfig(conf []byte) (Config, error) { return config, nil } -// HTTPConfig stores the http.Transport configuration for the cos client. -type HTTPConfig struct { - IdleConnTimeout model.Duration `yaml:"idle_conn_timeout"` - ResponseHeaderTimeout model.Duration `yaml:"response_header_timeout"` - TLSHandshakeTimeout model.Duration `yaml:"tls_handshake_timeout"` - ExpectContinueTimeout model.Duration `yaml:"expect_continue_timeout"` - MaxIdleConns int `yaml:"max_idle_conns"` - MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"` - MaxConnsPerHost int `yaml:"max_conns_per_host"` -} - // NewBucket returns a new Bucket using the provided cos configuration. func NewBucket(logger log.Logger, conf []byte, component string) (*Bucket, error) { if logger == nil {