Bug 1805133 - Could create alert receiver with same name from console
Summary: Could create alert receiver with same name from console
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.5.0
Assignee: David Taylor
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks: 1807660
TreeView+ depends on / blocked
 
Reported: 2020-02-20 10:38 UTC by Yanping Zhang
Modified: 2020-07-13 17:16 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Multiple Alert Receivers can be created with the same name. Consequence: In the Receiver's table, fields do not match up and deleting one receiver, all receivers with the name are deleted. Fix: In the Create Receiver form, user prompted with an error message if name already exists, and Create button disabled. Result: Users cannot create two receivers with the same name.
Clone Of:
: 1807660 (view as bug list)
Environment:
Last Closed: 2020-07-13 17:16:20 UTC
Target Upstream Version:


Attachments (Terms of Use)
receivers (76.38 KB, image/png)
2020-02-20 10:38 UTC, Yanping Zhang
no flags Details


Links
System ID Priority Status Summary Last Updated
Github openshift console pull 4516 None closed Bug 1805133: Could create alert receiver with same name from console 2020-09-02 05:19:28 UTC
Red Hat Product Errata RHBA-2020:2409 None None None 2020-07-13 17:16:49 UTC

Description Yanping Zhang 2020-02-20 10:38:43 UTC
Created attachment 1664309 [details]
receivers

Description of problem:
Create alert receiver from console, user could create receivers with same name, and routing labels shown on list is a combination of routing labels from all these receivers.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Create slack type alert receiver with name "test1" and routing label "test=one".
2.Create webhook type alert receiver with name "test1" and routing label "new=two"
3.Delete one receiver "test1" by clicking "Delete Receiver" in kebab.

Actual results:
1. Receiver "test1" is created.
2. Another receiver "test1" is created, and routing label for both "test1" receiver are "test=one new=two"
3. All receivers named "test1" are deleted.

Expected results:
2. Not sure if it's legal to have receivers with same name.
3. If receivers with same name could co-exist, should not delete all receivers when delete one of them. 

Additional info:

Comment 1 David Taylor 2020-02-21 14:45:37 UTC
I suggest we wait on implementing a whole bunch of UI/frontend receiver form validations.  The issue is that other k8s yaml is validated via the backend, since the alertmanger.yaml is stored in a Secret, it currently doesn't go through any yaml validation.

There is a JIRA story to investigate an overall alertmanger yaml schema validation strategy:
https://issues.redhat.com/browse/CONSOLE-2048

In the JIRA story, Sam P. mentions: ".. the monitoring guys are probably going to move [alertmanager] to a CRD in 4.5 if they do, we'd have the backend to validate for us so i'd probably hold off on [implementing more frontend validation]".

Comment 2 David Taylor 2020-02-21 16:35:26 UTC
Receiver's names should be unique:

# The unique name of the receiver.
name: <string>

https://prometheus.io/docs/alerting/configuration/#receiver

After some discussions it was determined that this will be fixed in console UI.
We do not know when/if monitoring team will switch alertmanager to a CRD, so until such time console will handle alertmanager.yaml validations.

Comment 5 Yanping Zhang 2020-03-06 07:04:09 UTC
Checked on OCP 4.5 cluster with payload 4.5.0-0.ci-2020-03-04-223611.
Create a alert receiver with name"test", then create another receiver, set name as "test" again, there is prompt info "A receiver with that name already exists.", and "Create" button is disabled.
The bug is fixed, so move it to Verified.

Comment 7 errata-xmlrpc 2020-07-13 17:16:20 UTC
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, 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


Note You need to log in before you can comment on or make changes to this bug.