Merge branch 'release-0.19'

This commit is contained in:
beorn7 2016-05-29 21:06:44 +02:00
commit e3ec8fa83b
4 changed files with 26 additions and 6 deletions

View File

@ -1,3 +1,9 @@
## 0.19.2 / 2016-05-29
* [BUGFIX] Correctly handle `GROUP_LEFT` and `GROUP_RIGHT` without labels in
string representation of expressions and in rules.
* [BUGFIX] Use `-web.external-url` for new status endpoints.
## 0.19.1 / 2016-05-25
* [BUGFIX] Handle service discovery panic affecting Kubernetes SD

View File

@ -1 +1 @@
0.19.1
0.19.2

View File

@ -165,11 +165,16 @@ func (node *BinaryExpr) String() string {
} else {
matching = fmt.Sprintf(" ON(%s)", vm.MatchingLabels)
}
if vm.Card == CardManyToOne {
matching += fmt.Sprintf(" GROUP_LEFT(%s)", vm.Include)
}
if vm.Card == CardOneToMany {
matching += fmt.Sprintf(" GROUP_RIGHT(%s)", vm.Include)
if vm.Card == CardManyToOne || vm.Card == CardOneToMany {
matching += " GROUP_"
if vm.Card == CardManyToOne {
matching += "LEFT"
} else {
matching += "RIGHT"
}
if len(vm.Include) > 0 {
matching += fmt.Sprintf("(%s)", vm.Include)
}
}
}
return fmt.Sprintf("%s %s%s%s %s", node.LHS, node.Op, returnBool, matching, node.RHS)

View File

@ -39,6 +39,15 @@ func TestExprString(t *testing.T) {
{
in: `a - ON(b) c`,
},
{
in: `a - ON(b) GROUP_LEFT(x) c`,
},
{
in: `a - ON(b) GROUP_LEFT(x, y) c`,
},
{
in: `a - ON(b) GROUP_LEFT c`,
},
{
in: `a - IGNORING(b) c`,
},