Commit a1215974 authored by Chris O'Haver's avatar Chris O'Haver Committed by Miek Gieben

only a * by itself is wild (#488)

parent 166c822d
...@@ -529,5 +529,5 @@ func (k *Kubernetes) getServiceRecordForIP(ip, name string) []msg.Service { ...@@ -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")
} }
...@@ -11,9 +11,9 @@ var testdataSymbolContainsWildcard = []struct { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment