feat(sandboxwarmpool): add Available status condition and observedGeneration - #1328
feat(sandboxwarmpool): add Available status condition and observedGeneration#1328prash2512 wants to merge 1 commit into
Conversation
✅ Deploy Preview for agent-sandbox canceled.
|
|
Hi @prash2512. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR adds ChangesSandboxWarmPool availability status
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant SandboxWarmPool
participant sandboxwarmpool_controller
participant Kubernetes_status_API
SandboxWarmPool->>sandboxwarmpool_controller: provide generation and replica state
sandboxwarmpool_controller->>sandboxwarmpool_controller: construct Available condition
sandboxwarmpool_controller->>Kubernetes_status_API: record ObservedGeneration and Conditions
Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR enhances the SandboxWarmPool extension API to expose Deployment-style status signaling so automation can reliably wait on pool health (e.g., kubectl wait --for=condition=Available sandboxwarmpool/<name>), instead of inspecting individual Sandbox resources.
Changes:
- Added
status.conditions(list-map ofmetav1.Condition) andstatus.observedGenerationtoSandboxWarmPool, including anAvailablecondition type and reason constants. - Updated the warm pool reconciler to set
ObservedGenerationand maintain theAvailablecondition viameta.SetStatusCondition. - Added unit and e2e tests validating
Available=Truebehavior, and regenerated API artifacts (deepcopy + CRDs + docs).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/extensions/warmpool_status_condition_test.go | New e2e test asserting Available=True and observedGeneration once the pool’s sandbox is ready. |
| extensions/controllers/sandboxwarmpool_controller.go | Sets status.observedGeneration and the Available condition during reconcile. |
| extensions/controllers/sandboxwarmpool_controller_test.go | Unit tests for the condition builder and reconcile wiring. |
| extensions/api/v1beta1/sandboxwarmpool_types.go | API changes: new Conditions + ObservedGeneration fields and related constants. |
| extensions/api/v1beta1/zz_generated.deepcopy.go | Regenerated deepcopy to properly deep-copy status.conditions. |
| docs/api.md | Regenerated API reference docs to include the new status fields. |
| k8s/crds/extensions.agents.x-k8s.io_sandboxwarmpools.yaml | Regenerated CRD schema to include status.conditions and status.observedGeneration. |
| helm/crds/extensions.agents.x-k8s.io_sandboxwarmpools.yaml | Regenerated Helm CRD schema changes for the new status fields. |
| olm/config/crd/bases/extensions.agents.x-k8s.io_sandboxwarmpools.yaml | Regenerated OLM CRD base schema changes for the new status fields. |
Files not reviewed (1)
- extensions/api/v1beta1/zz_generated.deepcopy.go: Generated file
…eration
Surface Deployment-style status on SandboxWarmPool so automation can block on
pool health with `kubectl wait --for=condition=Available sandboxwarmpool/<name>`
instead of inspecting individual sandboxes.
- add Conditions ([]metav1.Condition, list-map) and ObservedGeneration to
SandboxWarmPoolStatus, plus the Available condition type and the
SandboxWarmPoolMinimumReplicas{Available,Unavailable} reason constants
- set the Available condition (readyReplicas >= desiredReplicas) and
observedGeneration in reconcilePool via meta.SetStatusCondition; the existing
updateStatus DeepEqual gate suppresses no-op writes
- regenerate deepcopy and CRDs (k8s, helm, olm)
- unit tests for the condition builder and reconcile wiring, plus an e2e test
asserting Available=True once the pool's sandbox is ready
360f1ca to
37e1c8d
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aditya-shantanu, prash2512 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/assign @janetkuo @barney-s |
What this PR does / why we need it:
Surface Deployment-style status on SandboxWarmPool so automation can block on pool health with
kubectl wait --for=condition=Available sandboxwarmpool/<name>instead of inspecting individual sandboxes.Which issue(s) this PR is related to:
Fixes #188
Release Note
Note: Automated release notes are generated by Gemini using the PR description in the first section.
Please ensure that description is clear and comprehensive.
For breaking changes, ensure you describe the required actions clearly and the PR is labeled with
release-note-action-required.-->
Summary by CodeRabbit
New Features
Tests