@@ -28,18 +28,18 @@ func GetSecretOrConfigMap(file *flowslatest.FileReference) monitoringv1.SecretOr
2828 }
2929}
3030
31- func GetServiceMonitorTLSConfig (tls * flowslatest.ServerTLS , serverName string , isDownstream bool ) (string , * monitoringv1.TLSConfig ) {
31+ func GetServiceMonitorTLSConfig (tls * flowslatest.ServerTLS , serverName string , isDownstream bool ) (monitoringv1. Scheme , * monitoringv1.TLSConfig ) {
3232 if tls .Type == flowslatest .ServerTLSAuto {
3333 if isDownstream {
34- return "https" , & monitoringv1.TLSConfig {
34+ return monitoringv1 . SchemeHTTPS , & monitoringv1.TLSConfig {
3535 SafeTLSConfig : monitoringv1.SafeTLSConfig {
3636 ServerName : ptr .To (serverName ),
3737 },
3838 CAFile : "/etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt" ,
3939 }
4040 }
4141 // Upstream prometheus disallows CAFile
42- return "https" , & monitoringv1.TLSConfig {
42+ return monitoringv1 . SchemeHTTPS , & monitoringv1.TLSConfig {
4343 SafeTLSConfig : monitoringv1.SafeTLSConfig {
4444 ServerName : ptr .To (serverName ),
4545 CA : monitoringv1.SecretOrConfigMap {
@@ -64,8 +64,8 @@ func GetServiceMonitorTLSConfig(tls *flowslatest.ServerTLS, serverName string, i
6464 if ! tls .InsecureSkipVerify && tls .ProvidedCaFile != nil && tls .ProvidedCaFile .File != "" {
6565 tlsOut .SafeTLSConfig .CA = GetSecretOrConfigMap (tls .ProvidedCaFile )
6666 }
67- return "https" , & tlsOut
67+ return monitoringv1 . SchemeHTTPS , & tlsOut
6868 }
6969
70- return "http" , nil
70+ return monitoringv1 . SchemeHTTP , nil
7171}
0 commit comments