mirror of
https://github.com/status-im/consul.git
synced 2025-02-23 02:48:19 +00:00
Minor formatting tweaks as a follow-up to #2654
This commit is contained in:
parent
d8dd39ac40
commit
f48f105949
@ -399,12 +399,12 @@ func TestHealth_ServiceChecks_NodeMetaFilter(t *testing.T) {
|
|||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
var out structs.IndexedHealthChecks
|
var out structs.IndexedHealthChecks
|
||||||
inState := structs.ServiceSpecificRequest{
|
args := structs.ServiceSpecificRequest{
|
||||||
Datacenter: "dc1",
|
Datacenter: "dc1",
|
||||||
NodeMetaFilters: tc.filters,
|
NodeMetaFilters: tc.filters,
|
||||||
ServiceName: "db",
|
ServiceName: "db",
|
||||||
}
|
}
|
||||||
if err := msgpackrpc.CallWithCodec(codec, "Health.ServiceChecks", &inState, &out); err != nil {
|
if err := msgpackrpc.CallWithCodec(codec, "Health.ServiceChecks", &args, &out); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,6 +289,7 @@ type Node struct {
|
|||||||
}
|
}
|
||||||
type Nodes []*Node
|
type Nodes []*Node
|
||||||
|
|
||||||
|
// SatisfiesMetaFilters returns true if the metadata map contains the given filters
|
||||||
func SatisfiesMetaFilters(meta map[string]string, filters map[string]string) bool {
|
func SatisfiesMetaFilters(meta map[string]string, filters map[string]string) bool {
|
||||||
for key, value := range filters {
|
for key, value := range filters {
|
||||||
if v, ok := meta[key]; !ok || v != value {
|
if v, ok := meta[key]; !ok || v != value {
|
||||||
|
@ -165,8 +165,8 @@ func NewTestServer(t TestingT) *TestServer {
|
|||||||
// an optional callback function to modify the configuration.
|
// an optional callback function to modify the configuration.
|
||||||
func NewTestServerConfig(t TestingT, cb ServerConfigCallback) *TestServer {
|
func NewTestServerConfig(t TestingT, cb ServerConfigCallback) *TestServer {
|
||||||
if path, err := exec.LookPath("consul"); err != nil || path == "" {
|
if path, err := exec.LookPath("consul"); err != nil || path == "" {
|
||||||
t.Fatal("consul not found on $PATH - download and install " +
|
t.Fatal("consul not found on $PATH - download and install " +
|
||||||
"consul or skip this test")
|
"consul or skip this test")
|
||||||
}
|
}
|
||||||
|
|
||||||
dataDir, err := ioutil.TempDir("", "consul")
|
dataDir, err := ioutil.TempDir("", "consul")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user