fix: handle missing LVMVolumeGroupNodeStatus gracefully in vg-manager#2462
fix: handle missing LVMVolumeGroupNodeStatus gracefully in vg-manager#2462lmiccini wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe ChangesLVMVolumeGroupNodeStatus Not Found Error Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (13 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lmiccini 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 |
|
Welcome @lmiccini! It looks like this is your first PR to openshift/lvm-operator 🎉 |
|
Hi @lmiccini. Thanks for your PR. I'm waiting for a openshift 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. |
|
/ok-to-test |
|
/ok-to-test |
5e56bfe to
d309454
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@internal/controllers/vgmanager/controller_test.go`:
- Around line 804-815: The Reconciler in this test is built without Namespace so
getLVMVolumeGroupNodeStatus() queries the empty namespace and the test misses
the real race; set Namespace on the Reconciler to the volumeGroup's namespace
(e.g., Namespace: volumeGroup.GetNamespace()) when constructing the Reconciler
used for the "status does not exist yet" case and do the same for the subsequent
variant that injects a Get error so both use the correct namespace for Get
calls; update the Reconciler construction lines referencing Reconciler,
volumeGroup, and the injected-Get-error test to include Namespace:
volumeGroup.GetNamespace().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 432d2290-34cc-4f5d-afed-a865628ee683
📒 Files selected for processing (2)
internal/controllers/vgmanager/controller.gointernal/controllers/vgmanager/controller_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
- internal/controllers/vgmanager/controller.go
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2462 +/- ##
==========================================
+ Coverage 52.25% 56.92% +4.66%
==========================================
Files 52 53 +1
Lines 3896 4374 +478
==========================================
+ Hits 2036 2490 +454
- Misses 1697 1708 +11
- Partials 163 176 +13
🚀 New features to boost your workflow:
|
The vg-manager reconciler errors hard when the LVMVolumeGroupNodeStatus for its node does not yet exist, causing a permanent stuck state on some nodes during bootstrap. This happens because the LVMCluster controller creates NodeStatus resources in parallel with other resources, and the vg-manager can start reconciling before its NodeStatus is created. Handle the NotFound case by requeueing after 10 seconds instead of returning a hard error, giving the LVMCluster controller time to create the resource. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Luca Miccini <lmiccini@redhat.com>
d309454 to
c0c1f5d
Compare
|
/test e2e-aws-hypershift |
|
@lmiccini: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
/retest |
|
/ok-to-test |
|
/retest |
The vg-manager reconciler errors hard when the LVMVolumeGroupNodeStatus for its node does not yet exist, causing a permanent stuck state on some nodes during bootstrap. This happens because the LVMCluster controller creates NodeStatus resources in parallel with other resources, and the vg-manager can start reconciling before its NodeStatus is created.
Handle the NotFound case by requeueing after 10 seconds instead of returning a hard error, giving the LVMCluster controller time to create the resource.
Summary by CodeRabbit