Skip to content

Conversation

@tremes
Copy link
Contributor

@tremes tremes commented Jan 8, 2026

This is adding a new clusterHealthAnalyzer attribute to the monitoringConfig in the UIPlugin API.

This also marks the existing incidents attribute as deprecated and suggest to use the new clusterHealthAnalyzer instead.

// Incidents feature flag enablement
//
// +kubebuilder:validation:Optional
// +kubebuilder:deprecatedversion:warning="incidents is deprecated, use clusterHealthAnalyzer instead"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure the deprecatedversion will apply here as this is not a CRD version deprecation but a field in the CRD. We should use a +deprecated annotation and a CEL validation message:

// +kubebuilder:validation:XValidation:rule="!has(self.incidents)",message="field 'incidents' is deprecated and will be removed in v1.5.0; please migrate to 'clusterHealthAnalyzer'",reason="Warning"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am affraid that all the reasons (see https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-reason) block the request. So introducing this CEL rule would probably break COO upgrade (if incidents are enabled) and I think we would like to avoid it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok, I thought we could add a CEL rule in a non-blocking way. In that case the only remaining part is to set the +deprecation annotation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@jgbernalp
Copy link
Contributor

@tremes are we adding changes also in the logic to reconcile the incidents features based on the new and old flag?

@tremes
Copy link
Contributor Author

tremes commented Jan 13, 2026

@jgbernalp yes. There's definitely a plan to update the reconciliation & resources, but it's better to update the API first (since we have two Go modules) and then update the reconcile logic IMO.

@tremes tremes force-pushed the uiplugin-api-update-2 branch from 6e2410c to 30e07a6 Compare January 13, 2026 17:35
@jgbernalp
Copy link
Contributor

/lgtm

@jgbernalp
Copy link
Contributor

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jan 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, tremes

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-merge-bot openshift-merge-bot bot merged commit 7502b2b into rhobs:main Jan 15, 2026
11 checks passed
@openshift-ci
Copy link

openshift-ci bot commented Jan 15, 2026

@tremes: The following test 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/observability-operator-e2e 30e07a6 link unknown /test observability-operator-e2e

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.

// ClusterHealthAnalyzer feature flag enablement
//
// +kubebuilder:validation:Optional
ClusterHealthAnalyzer ClusterHealthAnalyzerReference `json:"clusterHealthAnalyzer,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be a pointer if optional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this was missed and fixed in the consequent PR.

//
// +kubebuilder:validation:Optional
// Deprecated: Use clusterHealthAnalyzer instead
// +deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

has the +deprecated marker any meaning? I don't see it mentioned in https://book.kubebuilder.io/reference/markers/crd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not. Definitely not a kubebuilder marker. I thought this is the "official" way in Go, but it's probably not.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants