a97d20cf63
Many places in consul already treated node names case insensitively. The state store indexes already do it, but there are a few places that did a direct byte comparison which have now been corrected. One place of particular consideration is ensureCheckIfNodeMatches which is executed during snapshot restore (among other places). If a node check used a slightly different casing than the casing of the node during register then the snapshot restore here would deterministically fail. This has been fixed. Primary approach: git grep -i "node.*[!=]=.*node" -- ':!*_test.go' ':!docs' git grep -i '\[[^]]*member[^]]*\] git grep -i '\[[^]]*\(member\|name\|node\)[^]]*\]' -- ':!*_test.go' ':!website' ':!ui' ':!agent/proxycfg/testing.go:' ':!*.md'
32 lines
553 B
Go
32 lines
553 B
Go
//go:build !consulent
|
|
// +build !consulent
|
|
|
|
package state
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
|
)
|
|
|
|
func (nst nodeServiceTuple) nodeTuple() nodeTuple {
|
|
return nodeTuple{
|
|
Node: strings.ToLower(nst.Node),
|
|
Partition: "",
|
|
}
|
|
}
|
|
|
|
func newNodeTupleFromNode(node *structs.Node) nodeTuple {
|
|
return nodeTuple{
|
|
Node: strings.ToLower(node.Node),
|
|
Partition: "",
|
|
}
|
|
}
|
|
|
|
func newNodeTupleFromHealthCheck(hc *structs.HealthCheck) nodeTuple {
|
|
return nodeTuple{
|
|
Node: strings.ToLower(hc.Node),
|
|
Partition: "",
|
|
}
|
|
}
|