bmcpfs: make VSC caching backend-agnostic via Backend/Instance#1764
Open
huww98 wants to merge 2 commits into
Open
bmcpfs: make VSC caching backend-agnostic via Backend/Instance#1764huww98 wants to merge 2 commits into
huww98 wants to merge 2 commits into
Conversation
Style cleanup: replace tea.String(x) with the new(x) builtin and errors.As with errors.AsType in the VSC package.
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: huww98 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 |
VscManager dispatched every call to the ECS or eflo backend by re-sniffing the instance ID (isECSInstance), duplicating the node-kind classification the CSI layer already computes from the node ID prefix — two sources of truth for the same ECS-vs-Lingjun fact. Introduce a Backend interface (each cloud owns its own type/status dialect via Ready) and an Instance value pairing an ID with its Backend. The CSI layer now resolves the backend once from the parsed node kind and passes a resolved Instance down, so PrimaryVscManagerWithCache becomes a pure caching decorator with no backend selection of its own. isECSInstance, dispatchingVscManager, the VscManager interface, and the now-redundant vscDialect struct are removed in favor of plain per-backend constants.
3a6a681 to
22f33e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Refactors the bmcpfs VSC layer to be backend-agnostic.
Previously
VscManagerdispatched every call to the ECS or eflo backend byre-sniffing the instance ID (
isECSInstance), which duplicated the node-kindclassification the CSI layer already computes from the node ID prefix — two
sources of truth for the same ECS-vs-Lingjun fact.
This PR introduces:
Backendinterface, where each cloud owns its own type/status dialect viaReady, andInstancevalue pairing an instance ID with itsBackend.The CSI layer now resolves the backend once from the parsed node kind and passes
a resolved
Instancedown, soPrimaryVscManagerWithCachebecomes a purecaching decorator with no backend selection of its own.
isECSInstance,dispatchingVscManager, theVscManagerinterface, and the now-redundantvscDialectstruct are removed in favor of plain per-backend constants.No behavior change; the existing cache / single-flight / poll tests are preserved
and updated to the new seam.
Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
Two commits, reviewable independently:
vsc.go(tea.String→new,errors.As→errors.AsType).Backend/Instancerefactor.Does this PR introduce a user-facing change?
🤖 Generated with Claude Code