From fb7ae3b29da523f6ec5da6f28f1be8db074bf7b6 Mon Sep 17 00:00:00 2001 From: Bharadwajshivam28 Date: Thu, 10 Oct 2024 09:43:55 +0530 Subject: [PATCH] feat: modified tls method to use exisiting behavior and allow tls skip --- .../controllers/common/providers/prometheus/common.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/metrics-operator/controllers/common/providers/prometheus/common.go b/metrics-operator/controllers/common/providers/prometheus/common.go index b27c54e4897..2a06de1cc3e 100644 --- a/metrics-operator/controllers/common/providers/prometheus/common.go +++ b/metrics-operator/controllers/common/providers/prometheus/common.go @@ -42,10 +42,9 @@ func (r RoundTripperRetriever) GetRoundTripper(ctx context.Context, provider met return nil, err } - transport := &http.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: provider.Spec.InsecureSkipTlsVerify, - }, + transport := promapi.DefaultRoundTripper.(*http.Transport).Clone() + transport.TLSClientConfig = &tls.Config{ + InsecureSkipVerify: provider.Spec.InsecureSkipTlsVerify, } return config.NewBasicAuthRoundTripper(secret.User, secret.Password, "", "", transport), nil