Bug 1804049
Summary: | Alertmanager: Prevent duplicate/same router label keys on Receiver forms | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | XiaochuanWang <xiaocwan> | ||||||
Component: | Management Console | Assignee: | David Taylor <dtaylor> | ||||||
Status: | CLOSED ERRATA | QA Contact: | XiaochuanWang <xiaocwan> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 4.4 | CC: | aos-bugs, jcaiani, jokerman, yapei | ||||||
Target Milestone: | --- | ||||||||
Target Release: | 4.5.0 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: |
Cause: Admin -> Cluster Settings -> Global Configuration -> Alertmanager -> Create Receiver. You are able create two routing labels with the same name/key.
Consequence: When 2 pairs of routing label have same key, it only shows latest one on list page. But if one of them use regular expression, detail page separate them as 2 pairs. If both of them are using/not using regular expression, the first one is replaced by second one.
Fix: Added validation and prevent adding two routing labels with same name/key.
Result: When one enters a routing label name which already exists they are presented with an error message "Routing Label names must be unique" and Save button is disabled until label name is changed.
|
Story Points: | --- | ||||||
Clone Of: | |||||||||
: | 1804777 (view as bug list) | Environment: | |||||||
Last Closed: | 2020-08-04 18:00:50 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1804777 | ||||||||
Attachments: |
|
Description
XiaochuanWang
2020-02-18 05:46:47 UTC
Created attachment 1663882 [details]
error trying to same yaml with multiple, same keys in single block
Created attachment 1663883 [details]
ok to have same keys in different blocks (match & match_re)
- Cannot have same keys in single block (see attachment 1663882 [details]) - When checking 'Regular Expression' checkbox, label key-values are saved to different block than non-regex labels (see attachment attachment 1663883 [details]) I see two issues: a) In the case where one has saved Routing labels like: "severity: warning [ ]Regular Exp." and "severity: ^err$ [X]Regular Exp." (which is valid, but I'm not sure logical given Alertmanagers AND'ing of route labels), the list page should show both labels -this is a bug b) Handling Same Keys - the code does reduce to unique keys per 'match' and 'match_re' yaml blocks. I recommend adding a validation to the Route Label Editor which highlights duplicate route label keys per regex and non-regex label sets. Not sure how logical/typical this usecase is though, would user enter 'severity: warning' and 'severity: error' labels thinking it was an OR situation (labels are AND'ed). Currently, I believe 'severity: error' would only be saved. I have a fix for (a) list page showing same key for regex and non-regex routing labels. irt. (b) Handling Same Keys - The instructions on the page say "Firing alerts with labels that match -->ALL<-- of these selectors...' so would a user logically create 'severity: warning' and 'severity: error' labels knowing an alert can never match these conditions? If so, should be validate for this, or are we ok with just saving single 'severity: error' label. I can look into validation, but it's complicated by the fact that the Route Label Editor is multi-rowed and we need to validate sets of labels (regex, non-regex). Similarly, a user can create "severity: warning [ ]Regular Exp."(non-regex) and "severity: ^info$ [X]Regular Exp." (regex w/ same key) which will be saved as separate routing labels, but logically the non-regex would need to/could be included in the regex label (due to ANDing). A simpler validation would be to just to make sure all routing labels are unique between non-regex(match) and regex (match_re) labels, even though technically you could have same keys in a regex and a non-regex label. idk, it's complex :-) Thanks David! Plz feel free to rephrase this bug since it includes different scenarios and complex logic. Hi, after review with team-monitoring the following doc: https://docs.google.com/document/d/1teEFDKZvgVEmgGSs-ZIJwLZEy7pHy-c-tZdSVKgCJ9k/edit We determined that the fix for this bug is to show an error message if user attempts to save form with duplicate/same router keys. Since user will not be able to save same keys, there is no need to update the list view to handle duplicate/same keys keys. This is fixed on 4.5.0-0.ci-2020-03-04-223611 Duplicated label key is not allowed to be saved. Both by console forms and YAML Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (OpenShift Container Platform 4.5 image release advisory), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2409 |