Skip to content

feat: add health checks for opendatahub.io DataScienceCluster and DSCInitialization (#26543)#27158

Open
officialasishkumar wants to merge 4 commits intoargoproj:masterfrom
officialasishkumar:feat/health-check-opendatahub-crd
Open

feat: add health checks for opendatahub.io DataScienceCluster and DSCInitialization (#26543)#27158
officialasishkumar wants to merge 4 commits intoargoproj:masterfrom
officialasishkumar:feat/health-check-opendatahub-crd

Conversation

@officialasishkumar
Copy link
Copy Markdown

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.

Summary

Adds built-in Lua health checks for two CRDs from the opendatahub.io API group:

  • datasciencecluster.opendatahub.io/DataScienceCluster
  • dscinitialization.opendatahub.io/DSCInitialization

These CRDs are used by OpenShift AI (Red Hat's managed ML platform) to manage platform lifecycle. Without native health checks, Argo CD reports these resources as Healthy even when they are still reconciling or in an error state.

Health Mapping

Both CRDs expose a .status.phase field. The mapping is:

.status.phase Argo CD Health
Ready Healthy
Error Degraded
Any other phase or missing status Progressing

When phase is Error, the errorMessage field from .status is used as the health message when available, giving operators immediate visibility into the failure reason.

Validation

  • Health check tests pass for all five scenarios per CRD: healthy, progressing, not ready, degraded (error), and missing status.
  • Phase values (Ready, Not Ready, Progressing, Error) verified against the opendatahub-operator source.

Closes #26543

Copilot AI review requested due to automatic review settings April 4, 2026 09:38
@officialasishkumar officialasishkumar requested a review from a team as a code owner April 4, 2026 09:38
@bunnyshell
Copy link
Copy Markdown

bunnyshell bot commented Apr 4, 2026

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds built-in Lua health checks for two opendatahub.io CRDs so Argo CD reports more accurate health based on .status.phase (e.g., Progressing vs Degraded vs Healthy).

Changes:

  • Add health.lua customizations for DataScienceCluster and DSCInitialization that map phase=Ready → Healthy, phase=Error → Degraded (with errorMessage), otherwise → Progressing.
  • Add health-check test suites (health_test.yaml) for both kinds.
  • Add representative test fixtures for ready, progressing, not-ready, degraded, and missing-status scenarios.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/health.lua Implements DSCInitialization health mapping from .status.phase (+ error message on Error).
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/health_test.yaml Adds health check test cases for DSCInitialization.
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/testdata/healthy.yaml Fixture: Ready/healthy DSCInitialization.
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/testdata/progressing.yaml Fixture: Progressing DSCInitialization.
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/testdata/progressing_not_ready.yaml Fixture: Not Ready DSCInitialization (expected Progressing).
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/testdata/degraded.yaml Fixture: Error/degraded DSCInitialization (with errorMessage).
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/testdata/no_status.yaml Fixture: Missing status DSCInitialization (expected Progressing).
resource_customizations/datasciencecluster.opendatahub.io/DataScienceCluster/health.lua Implements DataScienceCluster health mapping from .status.phase (+ error message on Error).
resource_customizations/datasciencecluster.opendatahub.io/DataScienceCluster/health_test.yaml Adds health check test cases for DataScienceCluster.
resource_customizations/datasciencecluster.opendatahub.io/DataScienceCluster/testdata/healthy.yaml Fixture: Ready/healthy DataScienceCluster.
resource_customizations/datasciencecluster.opendatahub.io/DataScienceCluster/testdata/progressing.yaml Fixture: Progressing DataScienceCluster.
resource_customizations/datasciencecluster.opendatahub.io/DataScienceCluster/testdata/progressing_not_ready.yaml Fixture: Not Ready DataScienceCluster (expected Progressing).
resource_customizations/datasciencecluster.opendatahub.io/DataScienceCluster/testdata/degraded.yaml Fixture: Error/degraded DataScienceCluster (with errorMessage).
resource_customizations/datasciencecluster.opendatahub.io/DataScienceCluster/testdata/no_status.yaml Fixture: Missing status DataScienceCluster (expected Progressing).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.35%. Comparing base (8c29202) to head (1a59f86).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27158      +/-   ##
==========================================
- Coverage   63.37%   63.35%   -0.02%     
==========================================
  Files         415      415              
  Lines       56555    56555              
==========================================
- Hits        35839    35830       -9     
- Misses      17338    17347       +9     
  Partials     3378     3378              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…Initialization

Add built-in Lua health checks for the DataScienceCluster and
DSCInitialization CRDs from the opendatahub.io API group. These CRDs
are used by OpenShift AI to manage platform lifecycle, and without
native health checks Argo CD cannot accurately report their readiness.

The health mapping is based on the .status.phase field:
- "Ready" maps to Healthy
- "Error" maps to Degraded (with errorMessage when available)
- Any other phase or missing status maps to Progressing

Closes argoproj#26543

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@officialasishkumar officialasishkumar force-pushed the feat/health-check-opendatahub-crd branch from 3f604ab to cd9d7f6 Compare April 7, 2026 05:49
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@officialasishkumar officialasishkumar force-pushed the feat/health-check-opendatahub-crd branch from cd9d7f6 to 85114ae Compare April 7, 2026 06:05
officialasishkumar and others added 2 commits April 7, 2026 21:18
Add a Progressing state when the observed generation does not match the
metadata generation, consistent with the DataScienceCluster health check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Add built-in Lua health checks for opendatahub.io CRDs (DataScienceCluster and DSCInitialization)

3 participants