Skip to content

MON-4037: Add MonitoringPluginConfig to ClusterMonitoring API#2768

Open
danielmellado wants to merge 1 commit intoopenshift:masterfrom
danielmellado:mon_4037_monitoring_plugin_config
Open

MON-4037: Add MonitoringPluginConfig to ClusterMonitoring API#2768
danielmellado wants to merge 1 commit intoopenshift:masterfrom
danielmellado:mon_4037_monitoring_plugin_config

Conversation

@danielmellado
Copy link
Copy Markdown
Contributor

No description provided.

@openshift-ci-robot
Copy link
Copy Markdown

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 17, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 17, 2026

@danielmellado: This pull request references MON-4037 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.22." or "openshift-4.22.", but it targets "openshift-5.0" instead.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 17, 2026

Hello @danielmellado! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 17, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 807a4d92-e9ae-4712-91f7-941bbed1976a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added a new optional monitoringPluginConfig field to ClusterMonitoringSpec and introduced the exported MonitoringPluginConfig type. The type is validated with minProperties=1 and exposes nodeSelector, resources, tolerations, and topologySpreadConstraints fields with explicit cardinality and map/list validation constraints. Generated deepcopy and Swagger doc methods were added/updated, and the CRD schema was extended to include the new field and its validation rules.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/v1alpha1/types_cluster_monitoring.go`:
- Around line 243-247: The Resources slice on the monitoring plugin config
currently only enforces MaxItems=10 (defined as the Resources
[]ContainerResource field) which allows an empty list; add a kubebuilder
validation tag to require at least one entry by adding
+kubebuilder:validation:MinItems=1 to the Resources field declaration so
monitoringPluginConfig.resources cannot be an empty array (update the Resources
[]ContainerResource json:"resources,omitempty,omitzero" field in
types_cluster_monitoring.go).

In
`@payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml`:
- Around line 1293-1294: The CRD currently allows an empty array for the
"resources" property even though the object requires non-empty content; update
the schema for the "resources" array(s) to include minItems: 1 (in addition to
the existing minProperties rule) so that resources: [] is rejected, and apply
the same change to all analogous "resources" schema blocks in this CRD to ensure
at least one item is required when the array is present.
- Around line 1614-1617: The CRD shows topologySpreadConstraints for
MonitoringPluginConfig using atomic list semantics; change the source markers
for MonitoringPluginConfig.TopologySpreadConstraints to use map-list semantics
by adding the kubebuilder markers +listType=map and two +listMapKey entries
(+listMapKey=topologyKey and +listMapKey=whenUnsatisfiable) so the generated CRD
replaces x-kubernetes-list-type: atomic with a keyed map list like its sibling
monitoring configs. Locate the MonitoringPluginConfig struct and update the
field tags/markers for TopologySpreadConstraints accordingly, then regenerate
the CRD.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 4854f825-5c11-4ca8-bb89-52abfc00b13e

📥 Commits

Reviewing files that changed from the base of the PR and between 5c75e62 and 7590acb.

⛔ Files ignored due to path filters (3)
  • config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**
📒 Files selected for processing (5)
  • config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml
  • config/v1alpha1/types_cluster_monitoring.go
  • config/v1alpha1/zz_generated.deepcopy.go
  • config/v1alpha1/zz_generated.swagger_doc_generated.go
  • payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml

@danielmellado danielmellado force-pushed the mon_4037_monitoring_plugin_config branch from 7590acb to 30b1be2 Compare March 17, 2026 12:24
@danielmellado
Copy link
Copy Markdown
Contributor Author

@everettraven coming ere from #2753, I addressed your comments, as there was an issue wit GH and the branch and the PR was closed, thanks!

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml (1)

1619-1622: ⚠️ Potential issue | 🟠 Major

topologySpreadConstraints still needs map-list semantics.

Line 1622 keeps this list atomic, so the uniqueness promise in Lines 1446-1447 is not enforced and server-side apply behavior diverges from the sibling monitoring configs. Please add +listType=map, +listMapKey=topologyKey, and +listMapKey=whenUnsatisfiable on MonitoringPluginConfig.TopologySpreadConstraints, then regenerate the CRD.

Expected generated shape
                     maxItems: 10
                     minItems: 1
                     type: array
-                    x-kubernetes-list-type: atomic
+                    x-kubernetes-list-map-keys:
+                    - topologyKey
+                    - whenUnsatisfiable
+                    x-kubernetes-list-type: map

Verify that metricsServerConfig.topologySpreadConstraints remains a keyed map list, monitoringPluginConfig.topologySpreadConstraints stops generating as atomic, and the source struct carries the matching kubebuilder markers.

#!/bin/bash
set -euo pipefail

crd='payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml'
types_file="$(fd 'types_cluster_monitoring\.go$' | head -n1)"
test -n "$types_file"

echo '== Generated CRD list semantics: metricsServerConfig vs monitoringPluginConfig =='
python - <<'PY'
from pathlib import Path

lines = Path("payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml").read_text().splitlines()

def show(section, next_section):
    start = next(i for i, l in enumerate(lines) if l.strip() == f"{section}:")
    end = next(i for i, l in enumerate(lines[start + 1:], start + 1) if l.strip() == f"{next_section}:")
    inside = False
    print(f"-- {section} --")
    for i in range(start, end):
        s = lines[i].strip()
        if s == "topologySpreadConstraints:":
            inside = True
        if not inside:
            continue
        if s in {
            "topologySpreadConstraints:",
            "maxItems: 10",
            "minItems: 1",
            "type: array",
            "x-kubernetes-list-map-keys:",
            "- topologyKey",
            "- whenUnsatisfiable",
            "x-kubernetes-list-type: atomic",
            "x-kubernetes-list-type: map",
        }:
            print(f"{i+1}:{lines[i]}")
        if s in {"x-kubernetes-list-type: atomic", "x-kubernetes-list-type: map"}:
            break

show("metricsServerConfig", "monitoringPluginConfig")
show("monitoringPluginConfig", "openShiftStateMetricsConfig")
PY

echo
echo '== Source markers for MonitoringPluginConfig =='
awk '
  /^type MonitoringPluginConfig struct/ {inblock=1}
  inblock {print NR ":" $0}
  inblock && /^}/ {exit}
' "$types_file"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml`
around lines 1619 - 1622, The CRD shows
MonitoringPluginConfig.topologySpreadConstraints as an atomic list; update the
source struct (MonitoringPluginConfig) field TopologySpreadConstraints to carry
the kubebuilder markers +listType=map and two +listMapKey entries
(+listMapKey=topologyKey and +listMapKey=whenUnsatisfiable), then regenerate the
CRD so monitoringPluginConfig.topologySpreadConstraints emits
x-kubernetes-list-type: map and x-kubernetes-list-map-keys matching
metricsServerConfig.topologySpreadConstraints.
🧹 Nitpick comments (1)
config/v1alpha1/types_cluster_monitoring.go (1)

274-277: Change MonitoringPluginConfig.TopologySpreadConstraints to map-style list semantics for API consistency.

MonitoringPluginConfig.TopologySpreadConstraints (lines 274–277) uses +listType=atomic, while all other TopologySpreadConstraints fields in this file (OpenShiftStateMetricsConfig, AlertmanagerConfig, MetricsServerConfig, PrometheusOperatorConfig, PrometheusOperatorAdmissionWebhookConfig, PrometheusConfig) use +listType=map keyed by topologyKey and whenUnsatisfiable. Aligning this field with map semantics would improve consistency across the API surface and provide better duplicate handling based on the naturally identifying fields of TopologySpreadConstraint.

Suggested change
-	// +listType=atomic
+	// +listType=map
+	// +listMapKey=topologyKey
+	// +listMapKey=whenUnsatisfiable
 	// +kubebuilder:validation:MinItems=1
 	// +kubebuilder:validation:MaxItems=10
 	TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/v1alpha1/types_cluster_monitoring.go` around lines 274 - 277, Change
the list semantics for MonitoringPluginConfig.TopologySpreadConstraints from
atomic to map to match the other types: replace the existing "+listType=atomic"
annotation with "+listType=map" and add a map key annotation listing the natural
identity fields (e.g. "+listMapKey=topologyKey,whenUnsatisfiable") so duplicates
are detected by those keys; update the comment block above the
TopologySpreadConstraints field in MonitoringPluginConfig to mirror the
annotations used on
OpenShiftStateMetricsConfig/AlertmanagerConfig/MetricsServerConfig/PrometheusOperatorConfig/PrometheusOperatorAdmissionWebhookConfig/PrometheusConfig.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml`:
- Around line 1619-1622: The CRD shows
MonitoringPluginConfig.topologySpreadConstraints as an atomic list; update the
source struct (MonitoringPluginConfig) field TopologySpreadConstraints to carry
the kubebuilder markers +listType=map and two +listMapKey entries
(+listMapKey=topologyKey and +listMapKey=whenUnsatisfiable), then regenerate the
CRD so monitoringPluginConfig.topologySpreadConstraints emits
x-kubernetes-list-type: map and x-kubernetes-list-map-keys matching
metricsServerConfig.topologySpreadConstraints.

---

Nitpick comments:
In `@config/v1alpha1/types_cluster_monitoring.go`:
- Around line 274-277: Change the list semantics for
MonitoringPluginConfig.TopologySpreadConstraints from atomic to map to match the
other types: replace the existing "+listType=atomic" annotation with
"+listType=map" and add a map key annotation listing the natural identity fields
(e.g. "+listMapKey=topologyKey,whenUnsatisfiable") so duplicates are detected by
those keys; update the comment block above the TopologySpreadConstraints field
in MonitoringPluginConfig to mirror the annotations used on
OpenShiftStateMetricsConfig/AlertmanagerConfig/MetricsServerConfig/PrometheusOperatorConfig/PrometheusOperatorAdmissionWebhookConfig/PrometheusConfig.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: d7a946f8-66f3-4667-8902-9c89aca1b367

📥 Commits

Reviewing files that changed from the base of the PR and between 7590acb and 30b1be2.

⛔ Files ignored due to path filters (3)
  • config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**
📒 Files selected for processing (5)
  • config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml
  • config/v1alpha1/types_cluster_monitoring.go
  • config/v1alpha1/zz_generated.deepcopy.go
  • config/v1alpha1/zz_generated.swagger_doc_generated.go
  • payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml
  • config/v1alpha1/zz_generated.deepcopy.go

@danielmellado
Copy link
Copy Markdown
Contributor Author

@everettraven could you PTAL when available? Thanks!

Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally seems fine aside from merge conflicts.

I suspect this needs some updating in relation to recent container resources CEL changes?

@danielmellado danielmellado force-pushed the mon_4037_monitoring_plugin_config branch from 30b1be2 to 860ad02 Compare April 7, 2026 09:30
@danielmellado
Copy link
Copy Markdown
Contributor Author

Hey, thanks for the review! Rebased onto latest master and fixed everything up. I also
did lower MaxItems from 10 to 5 on MonitoringPluginConfig.Resources though, to match the other config types and stay within the CRD CEL validation cost budget (per the comment near the ContainerResource type definition).

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml`:
- Around line 1403-1428: The CRD schema lacks enforcement for constrained enum
and dependent/threshold fields; update
config/v1alpha1/types_cluster_monitoring.go to add validated wrapper types or
XValidation rules for the ClusterMonitoring spec fields (validate enums for
effect, operator, whenUnsatisfiable, nodeAffinityPolicy, nodeTaintsPolicy;
enforce maxSkew>0 and minDomains>0; require matchLabelKeys only when
labelSelector is present), implement validation functions (or kubebuilder
annotations) on the relevant types/fields and then regenerate the CRD so the
payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml
includes the XValidation blocks and stricter schemas reflecting those
constraints.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: dcee3600-f546-4282-a07b-f73def79049e

📥 Commits

Reviewing files that changed from the base of the PR and between 30b1be2 and 860ad02.

⛔ Files ignored due to path filters (3)
  • config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**
📒 Files selected for processing (5)
  • config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml
  • config/v1alpha1/types_cluster_monitoring.go
  • config/v1alpha1/zz_generated.deepcopy.go
  • config/v1alpha1/zz_generated.swagger_doc_generated.go
  • payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml
✅ Files skipped from review due to trivial changes (2)
  • config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml
  • config/v1alpha1/types_cluster_monitoring.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/v1alpha1/zz_generated.swagger_doc_generated.go

Comment on lines +1403 to +1428
effect:
description: |-
Effect indicates the taint effect to match. Empty means match all taint effects.
When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
description: |-
Key is the taint key that the toleration applies to. Empty means match all taint keys.
If the key is empty, operator must be Exists; this combination means to match all values and all keys.
type: string
operator:
description: |-
Operator represents a key's relationship to the value.
Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal.
Exists is equivalent to wildcard for value, so that a pod can
tolerate all taints of a particular category.
Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators).
type: string
tolerationSeconds:
description: |-
TolerationSeconds represents the period of time the toleration (which must be
of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
it is not set, which means tolerate the taint forever (do not evict). Zero and
negative values will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Documented scheduling constraints are not enforced here.

This schema says effect/operator/whenUnsatisfiable/nodeAffinityPolicy/nodeTaintsPolicy have restricted values, maxSkew and minDomains must be positive, and matchLabelKeys depends on labelSelector, but the generated shape only types those fields. Examples like effect: Foo, maxSkew: 0, minDomains: 0, or matchLabelKeys without labelSelector would still validate here. Please add validated wrapper types or XValidations in config/v1alpha1/types_cluster_monitoring.go and regenerate the CRD.

Also applies to: 1504-1616

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml`
around lines 1403 - 1428, The CRD schema lacks enforcement for constrained enum
and dependent/threshold fields; update
config/v1alpha1/types_cluster_monitoring.go to add validated wrapper types or
XValidation rules for the ClusterMonitoring spec fields (validate enums for
effect, operator, whenUnsatisfiable, nodeAffinityPolicy, nodeTaintsPolicy;
enforce maxSkew>0 and minDomains>0; require matchLabelKeys only when
labelSelector is present), implement validation functions (or kubebuilder
annotations) on the relevant types/fields and then regenerate the CRD so the
payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml
includes the XValidation blocks and stricter schemas reflecting those
constraints.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally the approach we would recommend from an API review perspective, but there was already an separate agreement that because these values are being plumbed directly to a Pod Spec that it is OK to re-use the upstream types that don't implement the same markers used to generate the CRD schema with appropriate constraints.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@everettraven Acknowledged — thanks for the context. Given the prior agreement to reuse upstream PodSpec types for these scheduling fields, I won’t block on adding CRD-level XValidations here.

Non-blocking suggestions to reduce user surprise:

  • Add a one-liner to the field docs noting these are pass-throughs to PodSpec; enum/dependency checks are enforced by Kubernetes, not this CRD.
  • If you later want minimal guardrails without diverging much, consider cheap CEL rules like “maxSkew ≥ 1”, “minDomains ≥ 1 when set”, and “matchLabelKeys requires labelSelector” (subject to CEL cost budget).

No change requested from me otherwise.


📝 Learnings were identified and not saved (knowledge base disabled). Enable

@danielmellado danielmellado force-pushed the mon_4037_monitoring_plugin_config branch from 860ad02 to d980b5e Compare April 7, 2026 10:48
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml (1)

1403-1428: ⚠️ Potential issue | 🟠 Major

Documented constraints are still not enforced in schema.

The descriptions declare constrained values/relationships (for example effect/operator/whenUnsatisfiable, positive maxSkew/minDomains, and matchLabelKeys dependency on labelSelector), but this block still only types those fields. Invalid values and invalid combinations can pass CRD validation despite the documented contract.

Please add explicit enum/range/dependency validations in the source API type (config/v1alpha1/types_cluster_monitoring.go) and regenerate this CRD.

Also applies to: 1504-1616

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml`
around lines 1403 - 1428, The CRD allows invalid values/combinations because the
API types lack validation; update the source API
(config/v1alpha1/types_cluster_monitoring.go) to add kubebuilder validation
markers: enum tags for fields like Effect, Operator, WhenUnsatisfiable; minimum
(>0) or maximum tags for numeric fields like MaxSkew and MinDomains;
pattern/enum or required markers for matchLabelKeys and add an XValidations or
validation rule to enforce that matchLabelKeys is only allowed when
LabelSelector is present; then regenerate the CRD so the
payload-manifests/crds/..._clustermonitorings.crd.yaml includes these
enums/ranges/dependencies.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml`:
- Around line 1403-1428: The CRD allows invalid values/combinations because the
API types lack validation; update the source API
(config/v1alpha1/types_cluster_monitoring.go) to add kubebuilder validation
markers: enum tags for fields like Effect, Operator, WhenUnsatisfiable; minimum
(>0) or maximum tags for numeric fields like MaxSkew and MinDomains;
pattern/enum or required markers for matchLabelKeys and add an XValidations or
validation rule to enforce that matchLabelKeys is only allowed when
LabelSelector is present; then regenerate the CRD so the
payload-manifests/crds/..._clustermonitorings.crd.yaml includes these
enums/ranges/dependencies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 957d412b-78a5-4e54-aa44-56532f314fe4

📥 Commits

Reviewing files that changed from the base of the PR and between 860ad02 and d980b5e.

⛔ Files ignored due to path filters (3)
  • config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**
📒 Files selected for processing (4)
  • config/v1alpha1/types_cluster_monitoring.go
  • config/v1alpha1/zz_generated.deepcopy.go
  • config/v1alpha1/zz_generated.swagger_doc_generated.go
  • payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/v1alpha1/zz_generated.deepcopy.go

Signed-off-by: Daniel Mellado <dmellado@fedoraproject.org>
@danielmellado danielmellado force-pushed the mon_4037_monitoring_plugin_config branch from d980b5e to 5257bc5 Compare April 7, 2026 14:22
Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-hypershift
/test e2e-aws-ovn-hypershift-conformance
/test e2e-aws-ovn-techpreview
/test e2e-aws-serial-1of2
/test e2e-aws-serial-2of2
/test e2e-aws-serial-techpreview-1of2
/test e2e-aws-serial-techpreview-2of2
/test e2e-azure
/test e2e-gcp
/test e2e-upgrade
/test e2e-upgrade-out-of-change
/test minor-e2e-upgrade-minor

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 8, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: everettraven

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 8, 2026

@danielmellado: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-hypershift 5257bc5 link true /test e2e-aws-ovn-hypershift
ci/prow/e2e-azure 5257bc5 link true /test e2e-azure
ci/prow/e2e-aws-ovn-hypershift-conformance 5257bc5 link true /test e2e-aws-ovn-hypershift-conformance

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 8, 2026

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants