@@ -2260,7 +2260,6 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
22602260 server_name: alertmanager-main.openshift-monitoring.svc
22612261 static_configs:
22622262 - dnssrv+_web._tcp.alertmanager-operated.openshift-monitoring.svc
2263- proxy_url: https://example.com:8080/
22642263` ,
22652264 },
22662265 {
@@ -2278,7 +2277,6 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
22782277 server_name: alertmanager-user-workload.openshift-user-workload-monitoring.svc
22792278 static_configs:
22802279 - dnssrv+_web._tcp.alertmanager-operated.openshift-user-workload-monitoring.svc
2281- proxy_url: https://example.com:8080/
22822280` ,
22832281 },
22842282 {
@@ -2299,7 +2297,6 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
22992297 server_name: alertmanager-main.openshift-monitoring.svc
23002298 static_configs:
23012299 - dnssrv+_web._tcp.alertmanager-operated.openshift-monitoring.svc
2302- proxy_url: https://example.com:8080/
23032300- static_configs:
23042301 - alertmanager1-remote.com
23052302 - alertmanager1-remotex.com
@@ -2343,7 +2340,6 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
23432340 server_name: alertmanager-main.openshift-monitoring.svc
23442341 static_configs:
23452342 - dnssrv+_web._tcp.alertmanager-operated.openshift-monitoring.svc
2346- proxy_url: https://example.com:8080/
23472343- scheme: https
23482344 path_prefix: /path-prefix
23492345 api_version: v2
@@ -2374,7 +2370,6 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
23742370 server_name: alertmanager-main.openshift-monitoring.svc
23752371 static_configs:
23762372 - dnssrv+_web._tcp.alertmanager-operated.openshift-monitoring.svc
2377- proxy_url: https://example.com:8080/
23782373- http_config:
23792374 bearer_token_file: /etc/prometheus/secrets/bearer-token/key
23802375 static_configs:
@@ -2411,7 +2406,6 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
24112406 server_name: alertmanager-main.openshift-monitoring.svc
24122407 static_configs:
24132408 - dnssrv+_web._tcp.alertmanager-operated.openshift-monitoring.svc
2414- proxy_url: https://example.com:8080/
24152409- http_config:
24162410 tls_config:
24172411 ca_file: /etc/prometheus/secrets/alertmanager-tls/tls.ca
@@ -2452,7 +2446,6 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
24522446 server_name: alertmanager-main.openshift-monitoring.svc
24532447 static_configs:
24542448 - dnssrv+_web._tcp.alertmanager-operated.openshift-monitoring.svc
2455- proxy_url: https://example.com:8080/
24562449- http_config:
24572450 tls_config:
24582451 ca_file: /etc/prometheus/secrets/alertmanager-ca-tls/tls.ca
@@ -2497,7 +2490,6 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
24972490 server_name: alertmanager-main.openshift-monitoring.svc
24982491 static_configs:
24992492 - dnssrv+_web._tcp.alertmanager-operated.openshift-monitoring.svc
2500- proxy_url: https://example.com:8080/
25012493- scheme: https
25022494 api_version: v2
25032495 http_config:
@@ -2511,6 +2503,36 @@ func TestThanosRulerAdditionalAlertManagerConfigsSecret(t *testing.T) {
25112503 - alertmanager1-remote.com
25122504 - alertmanager1-remotex.com
25132505 proxy_url: https://example.com:8080/
2506+ ` ,
2507+ },
2508+ {
2509+ name : "proxy env http" ,
2510+ userWorkloadConfig : `thanosRuler:
2511+ additionalAlertmanagerConfigs:
2512+ - apiVersion: v2
2513+ pathPrefix: /path-prefix
2514+ scheme: http
2515+ staticConfigs:
2516+ - alertmanager1-remote.com
2517+ - alertmanager1-remotex.com
2518+ ` ,
2519+ expected : `alertmanagers:
2520+ - scheme: https
2521+ api_version: v2
2522+ http_config:
2523+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
2524+ tls_config:
2525+ ca_file: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
2526+ server_name: alertmanager-main.openshift-monitoring.svc
2527+ static_configs:
2528+ - dnssrv+_web._tcp.alertmanager-operated.openshift-monitoring.svc
2529+ - scheme: http
2530+ path_prefix: /path-prefix
2531+ api_version: v2
2532+ static_configs:
2533+ - alertmanager1-remote.com
2534+ - alertmanager1-remotex.com
2535+ proxy_url: http://example.com:8080/
25142536` ,
25152537 },
25162538 }
0 commit comments