Skip to content

Add SL for orphaned resources#417

Open
feichashao wants to merge 1 commit intoopenshift:masterfrom
feichashao:stale-resource-template
Open

Add SL for orphaned resources#417
feichashao wants to merge 1 commit intoopenshift:masterfrom
feichashao:stale-resource-template

Conversation

@feichashao
Copy link
Copy Markdown
Contributor

@feichashao feichashao commented Apr 2, 2026

Add a SL template about orphan resources. Sometime, there could be orphan resources that blocks operations. For example, I have seen a case, which an orphan pod blocking a service to delete, but somehow the namespace got forced deleted, leaving the pod not able to reconcile and failing the OVN database.

Summary by CodeRabbit

  • New Features
    • Added critical alerts for orphaned resource blocking operations, providing contextual details about affected operations, resource types, and namespaces.

@openshift-ci openshift-ci Bot requested review from Tessg22 and weherdh April 2, 2026 02:38
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: feichashao
Once this PR has been reviewed and has the lgtm label, please assign ayoung929 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 2, 2026

@feichashao: all tests passed!

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.

@krishvoor
Copy link
Copy Markdown
Member

@CodeRabbit-ai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

@krishvoor Sure, I'll review the changes in this PR right away!

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Walkthrough

A new JSON configuration file is added that defines an alert template for orphaned resource blocking cluster lifecycle operations, specifying severity level, service routing, log categorization, and parameterized message templates.

Changes

Cohort / File(s) Summary
Alert Template Configuration
osd/orphaned_resource_blocking_operations.json
New alert template defining orphaned resource blocking operations with Critical severity, routed to SREManualAction service, categorized as cluster-lifecycle logs, with templated summary and description messages using placeholder interpolation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add SL for orphaned resources' accurately describes the main change—adding a new Service Log template for handling orphaned resource blocking operations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed PR adds JSON configuration file to notification template repository with no Ginkgo tests present, so custom test name validation check does not apply.
Test Structure And Quality ✅ Passed The custom check requires reviewing Ginkgo test code, but this PR only adds a JSON configuration file to a template repository with no Go tests.
Microshift Test Compatibility ✅ Passed This PR adds only a JSON configuration file for orphaned resource blocking operations alerts. No Ginkgo e2e tests are introduced, so MicroShift compatibility verification is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The custom check for Single Node OpenShift (SNO) test compatibility is not applicable to this pull request. The PR only adds a JSON configuration file (osd/orphaned_resource_blocking_operations.json) containing alert/notification template configuration. The check specifically applies to new Ginkgo e2e tests, which are not present in this pull request.
Topology-Aware Scheduling Compatibility ✅ Passed Pull request adds only a notification template configuration file with no deployment manifests, operators, controllers, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check is not applicable to this PR, which only adds a JSON configuration file to a configuration/template repository with no executable code or binaries.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds only a JSON configuration file for orphaned resource blocking operations alerts; no Ginkgo e2e tests are included.

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

✨ 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.

🧹 Nitpick comments (1)
osd/orphaned_resource_blocking_operations.json (1)

6-6: Soften the remediation instruction to avoid impossible user action paths.

“Please delete the resource” is absolute; in some orphan scenarios users may not be able to delete it directly. Consider making this conditional and explicitly directing support escalation on failure.

✏️ Suggested wording update
-    "description": "Your cluster has an orphaned resource that is blocking ${OPERATION}. SRE has identified ${RESOURCE_TYPE} '${RESOURCE_NAME}' in namespace '${NAMESPACE}' as orphaned and preventing normal cluster functions. Please delete the resource. If you have questions about this operation, please open a support case.",
+    "description": "Your cluster has an orphaned resource that is blocking ${OPERATION}. SRE has identified ${RESOURCE_TYPE} '${RESOURCE_NAME}' in namespace '${NAMESPACE}' as orphaned and preventing normal cluster functions. Please try to delete the resource. If deletion is not possible or you have questions about this operation, please open a support case.",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@osd/orphaned_resource_blocking_operations.json` at line 6, Update the
"description" message in osd/orphaned_resource_blocking_operations.json to
soften the remediation: replace the absolute sentence "Please delete the
resource." with conditional guidance that asks the user to attempt deletion if
possible and, if deletion fails or is not possible, to escalate to support/SRE.
Keep the existing template variables (${OPERATION}, ${RESOURCE_TYPE},
${RESOURCE_NAME}, ${NAMESPACE}) and ensure the new text explicitly instructs the
user to open a support case or contact SRE when they cannot delete the resource
themselves.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@osd/orphaned_resource_blocking_operations.json`:
- Line 6: Update the "description" message in
osd/orphaned_resource_blocking_operations.json to soften the remediation:
replace the absolute sentence "Please delete the resource." with conditional
guidance that asks the user to attempt deletion if possible and, if deletion
fails or is not possible, to escalate to support/SRE. Keep the existing template
variables (${OPERATION}, ${RESOURCE_TYPE}, ${RESOURCE_NAME}, ${NAMESPACE}) and
ensure the new text explicitly instructs the user to open a support case or
contact SRE when they cannot delete the resource themselves.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b9b9e0d3-1680-42df-a60f-a88a5ceb2f67

📥 Commits

Reviewing files that changed from the base of the PR and between a1e9082 and 981540a.

📒 Files selected for processing (1)
  • osd/orphaned_resource_blocking_operations.json

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants