Unverified Commit 91bea3dd authored by Conor Broderick's avatar Conor Broderick Committed by GitHub

Merge pull request #932 from paystee/fix-label-matching

Fix label matching in routing tree editor
parents a3bfe8c8 2f78f749
......@@ -115,7 +115,10 @@ function matchLabels(matchers, labelSet) {
// Compare single matcher to labelSet
function matchLabel(matcher, labelSet) {
var v = labelSet[matcher.name];
var v = "";
if (matcher.name in labelSet) {
v = labelSet[matcher.name];
}
if (matcher.isRegex) {
return matcher.value.test(v)
......@@ -156,7 +159,7 @@ function massage(root) {
for (var key in root.match_re) {
var o = {};
o.isRegex = true;
o.value = new RegExp(root.match_re[key]);
o.value = new RegExp("^(?:" + root.match_re[key] + ")$");
o.name = key;
matchers.push(o);
}
......
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