mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-17 20:05:17 +00:00
Fix Route.ID()
returns conflicting IDs (#3803)
* Update TestRouteID tests This commit updates the TestRouteID tests to be more simple without reducing test coverage. It also adds new cases that show a bug in the existing code where conflicting IDs can be returned. Signed-off-by: George Robinson <george.robinson@grafana.com> * Fix Route.ID() returns conflicting IDs This commit fixes a bug where Route.ID() returns conflicting IDs. For example, the configuration: receiver: test routes: - matchers: - foo=bar continue: true routes: - matchers: - bar=baz - matchers: - foo=bar continue: true routes: - matchers: - bar=baz Gives the following Route IDs: {} {}/{foo="bar"}/0 {}/{foo="bar"}/{bar="baz"}/0 {}/{foo="bar"}/1 {}/{foo="bar"}/{bar="baz"}/0 When it should give these Route IDs: {} {}/{foo="bar"}/0 {}/{foo="bar"}/0/{bar="baz"}/0 {}/{foo="bar"}/1 {}/{foo="bar"}/1/{bar="baz"}/0 Signed-off-by: George Robinson <george.robinson@grafana.com> --------- Signed-off-by: George Robinson <george.robinson@grafana.com>
This commit is contained in:
parent
fc8c7d146f
commit
036eb508df