Skip to content

feat: crd report scaleddown phase status#1846

Merged
zzzming merged 2 commits into
mainfrom
operator-scale-down-status
Jun 12, 2026
Merged

feat: crd report scaleddown phase status#1846
zzzming merged 2 commits into
mainfrom
operator-scale-down-status

Conversation

@zzzming

@zzzming zzzming commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Improved status reporting for scaled-down deployments: components configured with zero replicas are now reported as "ScaledDown" when fully scaled to 0. If a component is configured to 0 but still has running instances, status shows a scaled-down-in-progress/not-ready state with clearer messaging.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b93dde9a-f1ed-4e1f-9668-470dd037b08e

📥 Commits

Reviewing files that changed from the base of the PR and between 18f80ea and 60081e7.

📒 Files selected for processing (1)
  • kubernetes/operator/internal/controller/status.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • kubernetes/operator/internal/controller/status.go

Walkthrough

Adds detection and reporting for when Backend, Frontend, and Langflow are all desired at 0 replicas: a new ScaledDown phase constant is defined and status logic now computes a scaled-down flag and treats zero-replica backend readiness as a special-case condition.

Changes

Scaled-Down State Handling

Layer / File(s) Summary
Phase constant definition
kubernetes/operator/internal/controller/openrag_controller.go
Introduces phaseScaledDown = "ScaledDown" constant to the controller's phase values.
Scaled-down status and condition handling
kubernetes/operator/internal/controller/status.go
updateStatusSuccess detects when Backend, Frontend, and Langflow desired replicas are all 0 and uses that flag with backend readiness to assign phaseScaledDown. updateBackendCondition treats desired backend replicas of 0 as a special case: sets backend condition True with reason ScaledDown when deployment replicas are 0, or False with reason ScaledDownNotReady when actual replicas have not yet converged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • langflow-ai/openrag#1619: Modifies the same controller status logic (updateStatusSuccess/updateBackendCondition) and phase/condition handling extended here for the scaled-to-zero case.

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: adding a 'ScaledDown' phase status to the CRD controller to report when the system is scaled down to zero replicas.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch operator-scale-down-status

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.

@github-actions github-actions Bot added the enhancement 🔵 New feature or request label Jun 11, 2026

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
kubernetes/operator/internal/controller/status.go (1)

37-45: 💤 Low value

Consider improving message clarity for the transitional scaled-down state.

The message on line 44 reads: "All components are set to be scaled to 0 replicas but waiting to scale down to be complete"

This is verbose and grammatically awkward. Consider a clearer alternative:

  • "Scaling down all components to 0 replicas (in progress)"
  • "Waiting for scale-down to 0 replicas to complete"
  • "Scale-down to 0 replicas in progress"

The logic itself is correct: treating scaled-down-with-backend-ready as a successful terminal state (ScaledDown phase) and scaled-down-but-not-ready as a transitional state (Reconciled phase with waiting message).

✨ Suggested message improvement
 		} else {
 			// Desired state is scaled down but backend condition is not true, treat as scaled down but not ready
-			message = "All components are set to be scaled to 0 replicas but waiting to scale down to be complete"
+			message = "Scaling down all components to 0 replicas (in progress)"
 		}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kubernetes/operator/internal/controller/status.go` around lines 37 - 45,
Replace the awkward transitional message when scaledDown is true but
backendConditionStatus != metav1.ConditionTrue with a clearer, concise phrase;
update the assignment to message in the status calculation block (the branch
using scaledDown and backendConditionStatus) to something like "Scale-down to 0
replicas in progress" or "Waiting for scale-down to 0 replicas to complete" so
the conditional handling in the status.go logic (variables scaledDown,
backendConditionStatus, metav1.ConditionTrue and phase variable/phaseScaledDown)
remains the same but the user-facing message is clearer and grammatically
correct.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@kubernetes/operator/internal/controller/status.go`:
- Around line 37-45: Replace the awkward transitional message when scaledDown is
true but backendConditionStatus != metav1.ConditionTrue with a clearer, concise
phrase; update the assignment to message in the status calculation block (the
branch using scaledDown and backendConditionStatus) to something like
"Scale-down to 0 replicas in progress" or "Waiting for scale-down to 0 replicas
to complete" so the conditional handling in the status.go logic (variables
scaledDown, backendConditionStatus, metav1.ConditionTrue and phase
variable/phaseScaledDown) remains the same but the user-facing message is
clearer and grammatically correct.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ba53611a-48a2-4d0e-ba31-08dfca4f73d5

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca787e and 18f80ea.

📒 Files selected for processing (2)
  • kubernetes/operator/internal/controller/openrag_controller.go
  • kubernetes/operator/internal/controller/status.go

@github-actions github-actions Bot added the lgtm label Jun 11, 2026
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jun 11, 2026
@zzzming zzzming merged commit 793d5a5 into main Jun 12, 2026
16 checks passed
@github-actions github-actions Bot deleted the operator-scale-down-status branch June 12, 2026 03:19
ricofurtado pushed a commit that referenced this pull request Jun 12, 2026
* crd report scaleddown phase status

* improve status message
ricofurtado added a commit that referenced this pull request Jun 12, 2026
…dingly (#1851)

* fix: handle document processing errors and update task statuses accordingly

* fix: add OCR handling for raster images during file ingestion

* style: ruff autofix (auto)

* fix: google to support WEBHOOK_BASE_URL (#1849)

* Update connector.py

* update env in settings

* fix webhook url of sharepoint

* feat: crd report scaleddown phase status (#1846)

* crd report scaleddown phase status

* improve status message

* chore: release 0.4.0.dev0 of sdks (#1847)

* release 0.4.1 of sdks

* dev 0

* dev 0

* 0.4.0-dev0

* feat: sdk scripts (#1848)

* sdk scripts

* Update main.py

* fix: put correct file type in langflow-less ingestion (#1842)

* FIxed no langflow ingestion

* style: ruff autofix (auto)

* add fallback for mime types

* style: ruff autofix (auto)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: add Python SDK smoke-test suite for remote/IBM SaaS deployments

Standalone uv project under scripts/test_scripts/sdk/python that exercises
every openrag-sdk functionality (settings, models, documents, search, chat,
knowledge filters, error handling) against a remote instance using IBM SaaS
header auth (X-Username / X-Api-Key), with pass/fail/skip reporting to
console, markdown, JSON, and a run log.

* style: ruff autofix (auto)

* Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Lucas Oliveira <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* style: ruff autofix (auto)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <[email protected]>
Co-authored-by: ming <[email protected]>
Co-authored-by: Lucas Oliveira <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Vchen7629 pushed a commit to Vchen7629/openrag that referenced this pull request Jun 15, 2026
…dingly (langflow-ai#1851)

* fix: handle document processing errors and update task statuses accordingly

* fix: add OCR handling for raster images during file ingestion

* style: ruff autofix (auto)

* fix: google to support WEBHOOK_BASE_URL (langflow-ai#1849)

* Update connector.py

* update env in settings

* fix webhook url of sharepoint

* feat: crd report scaleddown phase status (langflow-ai#1846)

* crd report scaleddown phase status

* improve status message

* chore: release 0.4.0.dev0 of sdks (langflow-ai#1847)

* release 0.4.1 of sdks

* dev 0

* dev 0

* 0.4.0-dev0

* feat: sdk scripts (langflow-ai#1848)

* sdk scripts

* Update main.py

* fix: put correct file type in langflow-less ingestion (langflow-ai#1842)

* FIxed no langflow ingestion

* style: ruff autofix (auto)

* add fallback for mime types

* style: ruff autofix (auto)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: add Python SDK smoke-test suite for remote/IBM SaaS deployments

Standalone uv project under scripts/test_scripts/sdk/python that exercises
every openrag-sdk functionality (settings, models, documents, search, chat,
knowledge filters, error handling) against a remote instance using IBM SaaS
header auth (X-Username / X-Api-Key), with pass/fail/skip reporting to
console, markdown, JSON, and a run log.

* style: ruff autofix (auto)

* Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Lucas Oliveira <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* style: ruff autofix (auto)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <[email protected]>
Co-authored-by: ming <[email protected]>
Co-authored-by: Lucas Oliveira <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
ricofurtado pushed a commit that referenced this pull request Jun 15, 2026
* crd report scaleddown phase status

* improve status message
ricofurtado added a commit that referenced this pull request Jun 15, 2026
…dingly (#1851)

* fix: handle document processing errors and update task statuses accordingly

* fix: add OCR handling for raster images during file ingestion

* style: ruff autofix (auto)

* fix: google to support WEBHOOK_BASE_URL (#1849)

* Update connector.py

* update env in settings

* fix webhook url of sharepoint

* feat: crd report scaleddown phase status (#1846)

* crd report scaleddown phase status

* improve status message

* chore: release 0.4.0.dev0 of sdks (#1847)

* release 0.4.1 of sdks

* dev 0

* dev 0

* 0.4.0-dev0

* feat: sdk scripts (#1848)

* sdk scripts

* Update main.py

* fix: put correct file type in langflow-less ingestion (#1842)

* FIxed no langflow ingestion

* style: ruff autofix (auto)

* add fallback for mime types

* style: ruff autofix (auto)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: add Python SDK smoke-test suite for remote/IBM SaaS deployments

Standalone uv project under scripts/test_scripts/sdk/python that exercises
every openrag-sdk functionality (settings, models, documents, search, chat,
knowledge filters, error handling) against a remote instance using IBM SaaS
header auth (X-Username / X-Api-Key), with pass/fail/skip reporting to
console, markdown, JSON, and a run log.

* style: ruff autofix (auto)

* Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Lucas Oliveira <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* style: ruff autofix (auto)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <[email protected]>
Co-authored-by: ming <[email protected]>
Co-authored-by: Lucas Oliveira <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 🔵 New feature or request lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants