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:
AvivGuiser
2024-08-05 09:56:17 -04:00
committed by GitHub
parent 338b318bf4
commit 93aa5a56ad
3 changed files with 19 additions and 11 deletions
+10
View File
@@ -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
}