From 54689f273928e240bd851cb4055c642b695edf1d Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki Date: Mon, 12 Apr 2021 12:04:37 +0300 Subject: [PATCH] [Alerting]: Fix YAML encoding/decoding issues when proxying lotex requests (#32854) * [Alerting]: Fix GET lotex rule group config * [Alerting]: Fix POST lotex user config --- pkg/services/ngalert/api/lotex_am.go | 2 +- pkg/services/ngalert/api/lotex_ruler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/services/ngalert/api/lotex_am.go b/pkg/services/ngalert/api/lotex_am.go index 89b946fba85..77b3d82f829 100644 --- a/pkg/services/ngalert/api/lotex_am.go +++ b/pkg/services/ngalert/api/lotex_am.go @@ -147,7 +147,7 @@ func (am *LotexAM) RouteGetSilences(ctx *models.ReqContext) response.Response { } func (am *LotexAM) RoutePostAlertingConfig(ctx *models.ReqContext, config apimodels.PostableUserConfig) response.Response { - yml, err := yaml.Marshal(config) + yml, err := yaml.Marshal(&config) if err != nil { return response.Error(500, "Failed marshal alert manager configuration ", err) } diff --git a/pkg/services/ngalert/api/lotex_ruler.go b/pkg/services/ngalert/api/lotex_ruler.go index 1e9b4d0a8d4..3836dfd6532 100644 --- a/pkg/services/ngalert/api/lotex_ruler.go +++ b/pkg/services/ngalert/api/lotex_ruler.go @@ -112,7 +112,7 @@ func (r *LotexRuler) RouteGetRulegGroupConfig(ctx *models.ReqContext) response.R ), ), nil, - yamlExtractor(apimodels.RuleGroupConfigResponse{}), + yamlExtractor(&apimodels.GettableRuleGroupConfig{}), nil, ) }