Skip to content

Commit

Permalink
embed: configure TLSInfo
Browse files Browse the repository at this point in the history
Signed-off-by: Gladkov Alexey <agladkov@redhat.com>
  • Loading branch information
legionus committed Jul 13, 2020
1 parent 07461ec commit 093db65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ type Config struct {
Metrics string `json:"metrics"`
ListenMetricsUrls []url.URL
ListenMetricsUrlsJSON string `json:"listen-metrics-urls"`
MetricsTLSInfo transport.TLSInfo

// Logger is logger options: currently only supports "zap".
// "capnslog" is removed in v3.5.
Expand Down
3 changes: 3 additions & 0 deletions embed/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,9 @@ func (e *Etcd) serveMetrics() (err error) {

for _, murl := range e.cfg.ListenMetricsUrls {
tlsInfo := &e.cfg.ClientTLSInfo
if !e.cfg.MetricsTLSInfo.Empty() {
tlsInfo = &e.cfg.MetricsTLSInfo
}
if murl.Scheme == "http" {
tlsInfo = nil
}
Expand Down

0 comments on commit 093db65

Please sign in to comment.