mirror of
https://github.com/prometheus/prometheus.git
synced 2026-06-04 22:22:39 -04:00
Merge pull request #18851 from roidelapluie/roidelapluie/fix-fill-printer
promql/parser: fix symmetric fill detection to compare values not pointers
This commit is contained in:
commit
5d90fd1dda
2 changed files with 5 additions and 1 deletions
|
|
@ -174,7 +174,7 @@ func (node *BinaryExpr) getMatchingStr() string {
|
|||
}
|
||||
|
||||
if vm.FillValues.LHS != nil || vm.FillValues.RHS != nil {
|
||||
if vm.FillValues.LHS == vm.FillValues.RHS {
|
||||
if vm.FillValues.LHS != nil && vm.FillValues.RHS != nil && *vm.FillValues.LHS == *vm.FillValues.RHS {
|
||||
matching += fmt.Sprintf(" fill (%v)", *vm.FillValues.LHS)
|
||||
} else {
|
||||
if vm.FillValues.LHS != nil {
|
||||
|
|
|
|||
|
|
@ -130,6 +130,10 @@ func TestExprString(t *testing.T) {
|
|||
in: `a + fill_left(-23) fill_right(42) b`,
|
||||
out: `a + fill_left (-23) fill_right (42) b`,
|
||||
},
|
||||
{
|
||||
in: `a + fill_left(5) fill_right(5) b`,
|
||||
out: `a + fill (5) b`,
|
||||
},
|
||||
{
|
||||
in: `a + on(b) group_left fill(-23) c`,
|
||||
out: `a + on (b) group_left () fill (-23) c`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue