Skip to content

Commit

Permalink
Added tls_config in downstream tripper config
Browse files Browse the repository at this point in the history
  • Loading branch information
Player256 committed Sep 25, 2023
1 parent acfa60c commit 3129371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/thanos/query_frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ func parseTransportConfiguration(downstreamTripperConfContentYaml []byte) (*http
if err := yaml.UnmarshalStrict(downstreamTripperConfContentYaml, tripperConfig); err != nil {
return nil, errors.Wrap(err, "parsing downstream tripper config YAML file")
}

if tripperConfig.TLSConfig != nil {
downstreamTripper.TLSClientConfig = tripperConfig.TLSConfig
}
if tripperConfig.IdleConnTimeout > 0 {
downstreamTripper.IdleConnTimeout = time.Duration(tripperConfig.IdleConnTimeout)
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/queryfrontend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package queryfrontend

import (
"crypto/tls"
"strings"
"time"

Expand Down Expand Up @@ -186,6 +187,7 @@ type DownstreamTripperConfig struct {
MaxIdleConns *int `yaml:"max_idle_conns"`
MaxIdleConnsPerHost *int `yaml:"max_idle_conns_per_host"`
MaxConnsPerHost *int `yaml:"max_conns_per_host"`
TLSConfig *tls.Config `yaml:"tls_config"`

CachePathOrContent extflag.PathOrContent
}
Expand Down Expand Up @@ -306,3 +308,4 @@ func (cfg *Config) isDynamicSplitSet() bool {
cfg.QueryRangeConfig.HorizontalShards > 0 ||
cfg.QueryRangeConfig.MaxQuerySplitInterval > 0
}

0 comments on commit 3129371

Please sign in to comment.