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

* [Alerting]: Fix GET lotex rule group config

* [Alerting]: Fix POST lotex user config
pull/32885/head
Sofia Papagiannaki 4 years ago committed by GitHub
parent f247526d6a
commit 54689f2739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/services/ngalert/api/lotex_am.go
  2. 2
      pkg/services/ngalert/api/lotex_ruler.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)
}

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

Loading…
Cancel
Save