[Alerting]: Fix YAML encoding/decoding issues when proxying lotex requests (#32854)

* [Alerting]: Fix GET lotex rule group config

* [Alerting]: Fix POST lotex user config
This commit is contained in:
Sofia Papagiannaki 2021-04-12 12:04:37 +03:00 committed by GitHub
parent f247526d6a
commit 54689f2739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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)
}

View File

@ -112,7 +112,7 @@ func (r *LotexRuler) RouteGetRulegGroupConfig(ctx *models.ReqContext) response.R
),
),
nil,
yamlExtractor(apimodels.RuleGroupConfigResponse{}),
yamlExtractor(&apimodels.GettableRuleGroupConfig{}),
nil,
)
}