Conversation
WalkthroughThis PR introduces a new Changes
Sequence DiagramsequenceDiagram
actor Reconciler as LV/LVSet Reconciler
participant DLH as DeviceLinkHandler
participant Cache as PV Link Cache
participant Client as API Client
Reconciler->>DLH: UpdateDeviceLinks(ctx, existing LVDL, blockDevice, currentSymlink)
DLH->>DLH: Deep-copy LVDL
DLH->>DLH: setStatusSymlinks(symlink paths)
alt Symlink computation error
DLH-->>Reconciler: error
else Success
DLH->>DLH: Check PreferredLinkTarget diff
alt Status unchanged
DLH-->>Reconciler: LVDL unchanged
else Status changed
alt PreferredLinkTarget changed
DLH->>DLH: Resolve owner object
DLH->>DLH: Record PreferredSymlinkChanged event
end
DLH->>Client: Status().Update(LVDL)
alt Update succeeds
Client-->>DLH: Updated object
DLH->>Cache: Update cache entry
DLH-->>Reconciler: Updated LVDL, nil error
else Update fails
Client-->>DLH: error
DLH-->>Reconciler: original LVDL, error
end
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pkg/common/device_link_handler.go`:
- Around line 166-175: The code currently logs and emits the
"PreferredSymlinkChanged" event before persisting the status update; change the
flow so that you call dl.client.Status().Update(ctx, copyToUpdate) first, check
err == nil, then call dl.recorder.Eventf(ownerObj, corev1.EventTypeNormal,
"PreferredSymlinkChanged", infoUpdate) and
dl.cacheWriter.AddOrUpdateLVDL(copyToUpdate). Locate the block that constructs
infoUpdate using existing.Status.PreferredLinkTarget and
copyToUpdate.Status.PreferredLinkTarget and move the Eventf invocation to the
success branch after dl.client.Status().Update; apply the same change to the
other analogous block that also emits the event (the second occurrence in the
file).
In `@pkg/diskmaker/controllers/lv/reconcile.go`:
- Around line 506-513: The code calls r.deviceLinkHandler.UpdateDeviceLinks(ctx,
lvdl, deviceLocation.BlockDevice, deviceLocation.UserProvidedPath) after
findDeviceByID failed, which overwrites lvdl.Status.CurrentLinkTarget with a
broken user path; change the call so UpdateDeviceLinks is not given the missing
deviceLocation.UserProvidedPath as the currentSymlink (pass an empty string or
nil-equivalent instead) so CurrentLinkTarget remains the existing live target in
lvdl; update the call site referencing UpdateDeviceLinks, lvdl, and
deviceLocation.UserProvidedPath accordingly and ensure any downstream logic
still reads lvdl.Status.CurrentLinkTarget.
🪄 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: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 58993d56-8bda-4521-b2d4-cd9f9dfa90ac
📒 Files selected for processing (8)
pkg/common/device_link_handler.gopkg/common/pv_link_cache.gopkg/common/pv_link_cache_test.gopkg/diskmaker/controllers/lv/reconcile.gopkg/diskmaker/controllers/lv/reconcile_test.gopkg/diskmaker/controllers/lvset/reconcile.gopkg/internal/diskutil.gopkg/internal/diskutil_test.go
8e54875 to
c3405ea
Compare
|
@gnufied: This pull request references Jira Issue OCPBUGS-84330, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@gnufied: This pull request references Jira Issue OCPBUGS-84330, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@gnufied: all tests passed! 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. |
Fixes https://redhat.atlassian.net/browse/OCPBUGS-84330
Summary by CodeRabbit
Bug Fixes
Tests