From 317e73de797c63bd56464c2260cd96b9acbc9875 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Wed, 5 Feb 2020 15:01:28 +0100 Subject: [PATCH] Hash YAML instead of JSON But it doesn't work either because of secret fields. Signed-off-by: Simon Pasquier --- storage/remote/storage.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/remote/storage.go b/storage/remote/storage.go index 5451fc2455..1b756af112 100644 --- a/storage/remote/storage.go +++ b/storage/remote/storage.go @@ -17,12 +17,12 @@ import ( "context" "crypto/md5" "encoding/hex" - "encoding/json" "fmt" "sync" "time" "github.com/go-kit/kit/log" + "gopkg.in/yaml.v2" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" @@ -174,7 +174,7 @@ func labelsToEqualityMatchers(ls model.LabelSet) []*labels.Matcher { // Used for hashing configs and diff'ing hashes in ApplyConfig. func toHash(data interface{}) (string, error) { - bytes, err := json.Marshal(data) + bytes, err := yaml.Marshal(data) if err != nil { return "", err }