Description of problem: tested https://issues.redhat.com/browse/MON-2091 with PR launch 4.11.0-0.nightly-2022-06-22-190830,openshift/cluster-monitoring-operator#1676 aws # oc create -f - << EOF apiVersion: monitoring.openshift.io/v1alpha1 kind: AlertRelabelConfig metadata: name: watchdog namespace: openshift-monitoring spec: configs: - sourceLabels: [alertname, severity] regex: "Watchdog;none" targetLabel: severity replacement: critical action: replace EOF The AlertRelabelConfig "watchdog" is invalid: spec.configs[0].action: Unsupported value: "replace": supported values: "Replace", "Keep", "Drop", "HashMod", "LabelMap", "LabelDrop", "LabelKeep" but from oc explian, replace is a valid value(other values are keep, drop, hashmod, labelmap, labeldrop, or labelkeep, which are lowercase), but the error reports supported values are capitalized: "Replace", "Keep", "Drop", "HashMod", "LabelMap", "LabelDrop", "LabelKeep". I think we should use the same value for AlertRelabelConfig. # oc explain AlertRelabelConfig.spec.configs.action KIND: AlertRelabelConfig VERSION: monitoring.openshift.io/v1alpha1 FIELD: action <string> DESCRIPTION: action to perform based on regex matching. Must be one of: replace, keep, drop, hashmod, labelmap, labeldrop, or labelkeep. Default is: 'replace' Version-Release number of selected component (if applicable): tested with PR How reproducible: always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
tested with 4.12.0-0.nightly-2022-08-12-053438, we still can not use lowercase action, but from the error logs, the supported values are the same with "oc explain AlertRelabelConfig.spec.configs.action", they are capitalized, is it expected? the tile for PR https://github.com/openshift/api/pull/1227 is wrong, it should be "exclude lowercase action in relabel_config validation", not include # oc create -f - << EOF apiVersion: monitoring.openshift.io/v1alpha1 kind: AlertRelabelConfig metadata: name: watchdog namespace: openshift-monitoring spec: configs: - sourceLabels: [alertname, severity] regex: "Watchdog;none" targetLabel: severity replacement: critical action: replace EOF The AlertRelabelConfig "watchdog" is invalid: spec.configs[0].action: Unsupported value: "replace": supported values: "Replace", "Keep", "Drop", "HashMod", "LabelMap", "LabelDrop", "LabelKeep" # oc get crd alertrelabelconfigs.monitoring.openshift.io -oyaml ... properties: action: default: Replace description: 'action to perform based on regex matching. Must be one of: Replace, Keep, Drop, HashMod, LabelMap, LabelDrop, or LabelKeep. Default is: ''Replace''' enum: - Replace - Keep - Drop - HashMod - LabelMap - LabelDrop ... # oc explain AlertRelabelConfig.spec.configs.action KIND: AlertRelabelConfig VERSION: monitoring.openshift.io/v1alpha1 FIELD: action <string> DESCRIPTION: action to perform based on regex matching. Must be one of: Replace, Keep, Drop, HashMod, LabelMap, LabelDrop, or LabelKeep. Default is: 'Replace'
Yes that is expected, please see Joel review: https://github.com/openshift/api/pull/1227#discussion_r929888681 I'll change the PR title accordingly, good catch!
based on Comment 9 and Comment 10, set 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 (Moderate: OpenShift Container Platform 4.12.0 bug fix and security update), 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/RHSA-2022:7399