Description of problem: Console should do special character check when create routing labels Version-Release number of selected component (if applicable): 4.3.0-0.nightly-2019-12-13-180405 How reproducible: Always Steps to Reproduce: 1. goto monitoring/alertmanagerconfig/receivers/~new page to create new receiver 2. input the required key and Routing Labels's name with special character, like .*% etc. 3. Then create Actual results: 3. token=`oc -n openshift-monitoring sa get-token prometheus-k8s` oc -n openshift-monitoring exec -c prometheus prometheus-k8s-1 -- curl -k -H "Authorization: Bearer $token" 'https://prometheus-k8s.openshift-monitoring.svc:9091/api/v1/alerts' | jq { "labels": { "alertname": "AlertmanagerFailedReload", "endpoint": "web", "instance": "10.128.2.10:9095", "job": "alertmanager-main", "namespace": "openshift-monitoring", "pod": "alertmanager-main-2", "service": "alertmanager-main", "severity": "warning" }, "annotations": { "message": "Reloading Alertmanager's configuration has failed for openshift-monitoring/alertmanager-main-2." }, "state": "firing", "activeAt": "2019-12-18T02:34:34.485794182Z", "value": "0e+00" }, Logs from pod alertmanager-main-2: level=info ts=2019-12-18T01:55:48.437Z caller=main.go:218 build_context="(go=go1.12.12, user=root@b6ceabe714d3, date=20191213-12:38:42)" level=info ts=2019-12-18T01:55:48.465Z caller=cluster.go:623 component=cluster msg="Waiting for gossip to settle..." interval=2s level=info ts=2019-12-18T01:55:48.507Z caller=coordinator.go:119 component=configuration msg="Loading configuration file" file=/etc/alertmanager/config/alertmanager.yaml level=error ts=2019-12-18T01:55:48.507Z caller=coordinator.go:124 component=configuration msg="Loading configuration file failed" file=/etc/alertmanager/config/alertmanager.yaml err="invalid label name \"trtrt.*\"" Expected results: Should have validation check like env setting: oc set env rc --all "^*^=test" error: environment variable ^*^=test is invalid, a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*') Additional info:
Tested on ocp 4.4 env with payload 4.4.0-0.nightly-2020-02-12-191550. Create alertmanager receiver, set routing label key with: #@$#$%, there will be info: Invalid name, and there is info in tooltip: Label name must not begin with a digit and contain only alphanumeric characters or '_'. The bug is fixed, so move it to Verified.
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:0581