Makes empty checkServiceNode return a nil.

The change in #2308 had an inadvertent interface change, so we fix that with
a special case in this fix.
This commit is contained in:
James Phillips 2016-08-29 19:12:07 -07:00
parent a7cfcc3634
commit 53149bd2f9
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11

View File

@ -1248,6 +1248,12 @@ func (s *StateStore) parseCheckServiceNodes(
return 0, nil, err
}
// Special-case the zero return value to nil, since this ends up in
// external APIs.
if len(services) == 0 {
return idx, nil, nil
}
results := make(structs.CheckServiceNodes, 0, len(services))
for _, sn := range services {
// Retrieve the node.