Skip to content

Commit

Permalink
[BREAKING] The value of the type or label should not be used to gener…
Browse files Browse the repository at this point in the history
…ate the Relation id.
  • Loading branch information
k1LoW committed Feb 8, 2021
1 parent b3fda01 commit b70dde3
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions config/relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"sort"
"strings"

"github.com/elliotchance/orderedmap"
Expand Down Expand Up @@ -95,16 +94,9 @@ func (rel *rawRelation) Id() string {
}
h := sha256.New()
seed := []string{}
seed = append(seed, rel.Type.Name)
for _, c := range rel.Components {
seed = append(seed, queryTrim(c))
}
sort.Slice(rel.Labels, func(i, j int) bool {
return rel.Labels[i] < rel.Labels[j]
})
for _, l := range rel.Labels {
seed = append(seed, l)
}
key := strings.ToLower(strings.Join(seed, "-"))
if _, err := io.WriteString(h, string(key)); err != nil {
return ""
Expand Down

0 comments on commit b70dde3

Please sign in to comment.