Alerting: Use stable identifier of a group,contact point,mute timing when export to HCL (#90917)
--------- Signed-off-by: Aviv Guiser <avivguiser@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -230,3 +231,12 @@ func containsProvisionedAlerts(provenances map[string]ngmodels.Provenance, rules
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func getHash(hashSlice []string) uint64 {
|
||||
sum := fnv.New64()
|
||||
for _, str := range hashSlice {
|
||||
_, _ = sum.Write([]byte(str))
|
||||
}
|
||||
hash := sum.Sum64()
|
||||
return hash
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user