mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 15:16:42 +00:00
app/vmalert: fix querybuild clone and extraParams merge logic #4340
fix Clone makes clone of VMStorage and ApplyParams
This commit is contained in:
parent
76f7e66d8e
commit
7a9ae9de0d
1 changed files with 11 additions and 1 deletions
|
@ -62,6 +62,7 @@ func (s *VMStorage) Clone() *VMStorage {
|
|||
queryStep: s.queryStep,
|
||||
appendTypePrefix: s.appendTypePrefix,
|
||||
dataSourceType: s.dataSourceType,
|
||||
extraParams: s.extraParams,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +70,16 @@ func (s *VMStorage) Clone() *VMStorage {
|
|||
func (s *VMStorage) ApplyParams(params QuerierParams) *VMStorage {
|
||||
s.dataSourceType = toDatasourceType(params.DataSourceType)
|
||||
s.evaluationInterval = params.EvaluationInterval
|
||||
s.extraParams = params.QueryParams
|
||||
if len(params.QueryParams) != 0 {
|
||||
for k, vl := range params.QueryParams {
|
||||
if s.extraParams.Has(k) {
|
||||
s.extraParams.Del(k)
|
||||
}
|
||||
for _, v := range vl {
|
||||
s.extraParams.Add(k, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
s.debug = params.Debug
|
||||
if params.Headers != nil {
|
||||
for key, value := range params.Headers {
|
||||
|
|
Loading…
Reference in a new issue