From 4fbfd91b0a0059de93279e7c7cd06d974f91bd2a Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:58:05 -0400 Subject: [PATCH] Allow the single monitoring endpoint to use http scheme --- utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index a2f5f8d4c..0f84539a7 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -1201,7 +1201,7 @@ func CustomizeServiceMonitor(sm *prometheusv1.ServiceMonitor, ba common.BaseComp sm.Spec.Endpoints[0].HonorLabels = endpoints[0].HonorLabels } if ba.GetManageTLS() == nil || *ba.GetManageTLS() { - if len(ba.GetMonitoring().GetEndpoints()) == 0 || ba.GetMonitoring().GetEndpoints()[0].TLSConfig == nil { + if len(ba.GetMonitoring().GetEndpoints()) == 0 || (ba.GetMonitoring().GetEndpoints()[0].TLSConfig == nil && ba.GetMonitoring().GetEndpoints()[0].Scheme != "http") { sm.Spec.Endpoints[0].Scheme = "https" if sm.Spec.Endpoints[0].TLSConfig == nil { sm.Spec.Endpoints[0].TLSConfig = &prometheusv1.TLSConfig{}