Fix regex filters to match complete string.
If someone specifies service = "foo-service" ...they probably don't want it to match: service = "foo-servicebar"
This commit is contained in:
parent
648a79a3e1
commit
a8bd98b7e1
|
@ -33,8 +33,8 @@ func NewFilter(namePattern string, valuePattern string) *Filter {
|
||||||
fmt.Fprintf(summer, namePattern, valuePattern)
|
fmt.Fprintf(summer, namePattern, valuePattern)
|
||||||
|
|
||||||
return &Filter{
|
return &Filter{
|
||||||
Name: regexp.MustCompile(namePattern),
|
Name: regexp.MustCompile("^" + namePattern + "$"),
|
||||||
Value: regexp.MustCompile(valuePattern),
|
Value: regexp.MustCompile("^" + valuePattern + "$"),
|
||||||
fingerprint: summer.Sum64(),
|
fingerprint: summer.Sum64(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue