fix(contrib/config/polaris): it only supports json format for configuration contents, add more content formats support (#4126)

This commit is contained in:
star liu
2025-01-22 19:20:21 +08:00
committed by GitHub
parent 99f0fb14a1
commit 1f8845291a

View File

@ -147,7 +147,7 @@ func (c *Client) doUpdate(ctx context.Context) (err error) {
return gerror.New("config file is empty")
}
var j *gjson.Json
if j, err = gjson.DecodeToJson([]byte(c.client.GetContent())); err != nil {
if j, err = gjson.LoadContent([]byte(c.client.GetContent())); err != nil {
return gerror.Wrap(err, `parse config map item from polaris failed`)
}
c.value.Set(j)