Skip to content

OCPBUGS-12988: force degraded status if ExporterImage is set#4227

Open
ffromani wants to merge 2 commits into
mainfrom
deprecate-user-set-exporter-image
Open

OCPBUGS-12988: force degraded status if ExporterImage is set#4227
ffromani wants to merge 2 commits into
mainfrom
deprecate-user-set-exporter-image

Conversation

@ffromani
Copy link
Copy Markdown
Member

ExporterImage is an escape hatch we had from day0 but which we never really leveraged. It made on the stable API and we can't deprecate it anytime soon, but we can at least narrow down the perimeter and make it obvious and loud it should not be used.
Force the status to Degraded if the ExporterImage is set by the user.

@openshift-ci-robot
Copy link
Copy Markdown

@ffromani: This pull request references Jira Issue OCPBUGS-12988, which is invalid:

  • expected the weakness to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

ExporterImage is an escape hatch we had from day0 but which we never really leveraged. It made on the stable API and we can't deprecate it anytime soon, but we can at least narrow down the perimeter and make it obvious and loud it should not be used.
Force the status to Degraded if the ExporterImage is set by the user.

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 May 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani

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 requested a review from shajmakh May 27, 2026 15:56
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 27, 2026
@openshift-ci openshift-ci Bot requested a review from swatisehgal May 27, 2026 15:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Review Change Stack

Warning

Review limit reached

@ffromani, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 27 minutes and 38 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: e4a9a8f6-2bc6-4d31-a69d-74a009f166bc

📥 Commits

Reviewing files that changed from the base of the PR and between 2bbcc86 and eaba13e.

📒 Files selected for processing (3)
  • internal/controller/numaresourcesoperator_controller.go
  • internal/controller/numaresourcesoperator_controller_test.go
  • pkg/status/status.go
📝 Walkthrough

Walkthrough

The PR adds detection and status degradation for custom operand images in NUMAResourcesOperator. A new status condition type ConditionTypeCustomUserImage is introduced, and status degradation methods are refactored to support both formatted messages and error-based messages. The reconcile loop now checks whether a custom image is configured and degrades operator status accordingly, with test coverage validating the behavior.

Changes

Custom ExporterImage Status Condition

Layer / File(s) Summary
Status condition type and degradation refactoring
pkg/status/status.go, internal/controller/numaresourcesoperator_controller.go
New ConditionTypeCustomUserImage constant added. Degradation logic refactored: new degradeStatusf method formats degradation messages, shared degradeStatusWithInfo helper computes updated conditions and patches status, and existing degradeStatus delegates to the shared helper. Existing CR name validation path updated to use degradeStatusf.
Custom ExporterImage detection and test
internal/controller/numaresourcesoperator_controller.go, internal/controller/numaresourcesoperator_controller_test.go
Reconcile loop checks whether Spec.ExporterImage is set after reconciliation completes; if present, operator status is degraded with CustomUserImage condition. New Ginkgo test provisions NRO with custom image, runs reconciliation, and asserts degraded condition with correct reason.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: forcing degraded status when ExporterImage is set, directly matching the primary objective of the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale and intent behind forcing degraded status for the ExporterImage field.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deprecate-user-set-exporter-image

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ffromani
Copy link
Copy Markdown
Member Author

/jira refresh

@openshift-ci-robot
Copy link
Copy Markdown

@ffromani: This pull request references Jira Issue OCPBUGS-12988, which is invalid:

  • expected the weakness to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@ffromani
Copy link
Copy Markdown
Member Author

/jira refresh

@openshift-ci-robot
Copy link
Copy Markdown

@ffromani: This pull request references Jira Issue OCPBUGS-12988, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @shajmakh

Details

In response to this:

/jira refresh

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.

ffromani added 2 commits May 27, 2026 18:24
Instead of forcing the callers to build an error where none is found,
add a `degradeStatus` variant which takes a format string.

AI-attribution: AIA PAI Ce Hin R claude-4.6-opus-1M v1.0
Signed-off-by: Francesco Romani <fromani@redhat.com>
…ge is set

ExporterImage is an escape hatch we had from day0 but which we never
really leveraged. It made on the stable API and we can't deprecate
it anytime soon, but we can at least narrow down
the perimeter and make it obvious and loud it should not be used.

Force the status to Degraded if the ExporterImage is set by the user.

AI-attribution: AIA PAI Ce Hin R claude-4.6-opus-1M v1.0
Signed-off-by: Francesco Romani <fromani@redhat.com>
@ffromani ffromani force-pushed the deprecate-user-set-exporter-image branch from 2bbcc86 to eaba13e Compare May 27, 2026 16:25
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants