diff --git a/consul/health_endpoint_test.go b/consul/health_endpoint_test.go index dec7f61a26..f0290947af 100644 --- a/consul/health_endpoint_test.go +++ b/consul/health_endpoint_test.go @@ -399,12 +399,12 @@ func TestHealth_ServiceChecks_NodeMetaFilter(t *testing.T) { for _, tc := range cases { var out structs.IndexedHealthChecks - inState := structs.ServiceSpecificRequest{ + args := structs.ServiceSpecificRequest{ Datacenter: "dc1", NodeMetaFilters: tc.filters, 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) } diff --git a/consul/structs/structs.go b/consul/structs/structs.go index bf09ca3770..15c6967b09 100644 --- a/consul/structs/structs.go +++ b/consul/structs/structs.go @@ -289,6 +289,7 @@ type Node struct { } 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 { for key, value := range filters { if v, ok := meta[key]; !ok || v != value { diff --git a/testutil/server.go b/testutil/server.go index 7573790aa6..ed719beb72 100644 --- a/testutil/server.go +++ b/testutil/server.go @@ -165,8 +165,8 @@ func NewTestServer(t TestingT) *TestServer { // an optional callback function to modify the configuration. func NewTestServerConfig(t TestingT, cb ServerConfigCallback) *TestServer { if path, err := exec.LookPath("consul"); err != nil || path == "" { - t.Fatal("consul not found on $PATH - download and install " + - "consul or skip this test") + t.Fatal("consul not found on $PATH - download and install " + + "consul or skip this test") } dataDir, err := ioutil.TempDir("", "consul")