Description of problem: A user with the monitoring-rules-edit role should be able to edit PrometheusRules resources. Version-Release number of selected component (if applicable): 4.5 nightly How reproducible: Always Steps to Reproduce: 1. Create a user and bind this user to the monitoring-rules-edit role for the openshift-monitoring namesapce. oc adm policy add-role-to-user -n openshift-monitoring monitoring-rules-edit simon 2. Login as the new user. 3. Create a PrometheusRules resource in the openshift-monitoring namespace. cat <<EOF | oc apply -f - apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: test namespace: openshift-monitoring spec: groups: - name: test rules: - expr: 1 record: test EOF 3. Run "oc -n openshift-monitoring edit prometheusrules test" and edit the "expr" field (changing it to 0 for instance). Actual results: error: prometheusrules.monitoring.coreos.com "test" could not be patched: prometheusrules.monitoring.coreos.com "test" is forbidden: User "simon" cannot patch resource "prometheusrules" in A PI group "monitoring.coreos.com" in the namespace "openshift-monitoring" You can run `oc replace -f /tmp/oc-edit-e95x8.yaml` to try this update again. Expected results: No error. Additional info:
Tested with 4.5.0-0.nightly-2020-04-27-192810, monitoring-rules-edit and monitoring-edit can update resources $ oc -n test edit prometheusrule/watchdog.rules prometheusrule.monitoring.coreos.com/watchdog.rules edited $ oc -n test edit ServiceMonitor new-servicemonitor servicemonitor.monitoring.coreos.com/new-servicemonitor edited $ oc -n test edit PodMonitor new-podmonitor podmonitor.monitoring.coreos.com/new-podmonitor edited
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