From fefeb6283138ff66161a49bec371e4a8c6e82919 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Tue, 5 Jul 2022 10:32:17 +0200 Subject: [PATCH] Get PR 2050 through the finish line (#2317) * 2044 reenable proxy_url * Removed unused variable errProxyURLNotAllowed Signed-off-by: Marco Pracucci * Update PR number Signed-off-by: Marco Pracucci * Update CHANGELOG.md Co-authored-by: Arve Knudsen * Keep blocking OAuth2 HTTP proxy because it's not protected by our firewall Signed-off-by: Marco Pracucci Co-authored-by: supergicko Co-authored-by: Arve Knudsen --- CHANGELOG.md | 1 + pkg/alertmanager/api.go | 3 --- pkg/alertmanager/api_test.go | 18 ------------------ 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 934ab970b32..1d606e53323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * [CHANGE] Compactor: delete source and output blocks from local disk on compaction failed, to reduce likelihood that subsequent compactions fail because of no space left on disk. #2261 * [CHANGE] Ruler: Remove unused CLI flags `-ruler.search-pending-for` and `-ruler.flush-period` (and their respective YAML config options). #2288 +* [ENHANCEMENT] Alertmanager: Allow the HTTP `proxy_url` configuration option in the receiver's configuration. #2317 * [BUGFIX] Compactor: log the actual error on compaction failed. #2261 ### Mixin diff --git a/pkg/alertmanager/api.go b/pkg/alertmanager/api.go index 95cc98a2541..7ed93454b73 100644 --- a/pkg/alertmanager/api.go +++ b/pkg/alertmanager/api.go @@ -422,9 +422,6 @@ func validateReceiverHTTPConfig(cfg commoncfg.HTTPClientConfig) error { if cfg.BearerTokenFile != "" { return errPasswordFileNotAllowed } - if cfg.ProxyURL.URL != nil { - return errProxyURLNotAllowed - } if cfg.OAuth2 != nil && cfg.OAuth2.ClientSecretFile != "" { return errOAuth2SecretFileNotAllowed } diff --git a/pkg/alertmanager/api_test.go b/pkg/alertmanager/api_test.go index 7b8b8f7eb12..23db41f10ee 100644 --- a/pkg/alertmanager/api_test.go +++ b/pkg/alertmanager/api_test.go @@ -317,7 +317,6 @@ alertmanager_config: | client_secret: xxx token_url: http://example.com proxy_url: http://example.com - route: receiver: 'default-receiver' receivers: @@ -428,23 +427,6 @@ alertmanager_config: | token_url: http://example.com client_secret: xxx proxy_url: http://localhost - - route: - receiver: 'default-receiver' -`, - err: errors.Wrap(errProxyURLNotAllowed, "error validating Alertmanager config"), - }, - { - name: "Should return error if receiver's HTTP proxy_url is set", - cfg: ` -alertmanager_config: | - receivers: - - name: default-receiver - webhook_configs: - - url: http://localhost - http_config: - proxy_url: http://localhost - route: receiver: 'default-receiver' `,