only a * by itself is wild (#488)

This commit is contained in:
Chris O'Haver 2017-01-22 03:15:12 -05:00 committed by Miek Gieben
parent 166c822d91
commit a1215974ee
2 changed files with 4 additions and 4 deletions

View file

@ -529,5 +529,5 @@ func (k *Kubernetes) getServiceRecordForIP(ip, name string) []msg.Service {
// symbolContainsWildcard checks whether symbol contains a wildcard value // symbolContainsWildcard checks whether symbol contains a wildcard value
func symbolContainsWildcard(symbol string) bool { func symbolContainsWildcard(symbol string) bool {
return (strings.Contains(symbol, "*") || (symbol == "any")) return (symbol == "*" || symbol == "any")
} }

View file

@ -11,9 +11,9 @@ var testdataSymbolContainsWildcard = []struct {
{"mynamespace", false}, {"mynamespace", false},
{"*", true}, {"*", true},
{"any", true}, {"any", true},
{"my*space", true}, {"my*space", false},
{"*space", true}, {"*space", false},
{"myname*", true}, {"myname*", false},
} }
func TestSymbolContainsWildcard(t *testing.T) { func TestSymbolContainsWildcard(t *testing.T) {