Skip to content

bmcpfs: make VSC caching backend-agnostic via Backend/Instance#1764

Open
huww98 wants to merge 2 commits into
kubernetes-sigs:masterfrom
huww98:refactor/bmcpfs-vsc-backend
Open

bmcpfs: make VSC caching backend-agnostic via Backend/Instance#1764
huww98 wants to merge 2 commits into
kubernetes-sigs:masterfrom
huww98:refactor/bmcpfs-vsc-backend

Conversation

@huww98

@huww98 huww98 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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 VscManager dispatched every call to the ECS or eflo backend by
re-sniffing the instance ID (isECSInstance), which duplicated 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.

This PR introduces:

  • a Backend interface, where each cloud owns its own type/status dialect via
    Ready, and
  • an Instance value pairing an instance 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.

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:

  1. Style cleanup in vsc.go (tea.Stringnew, errors.Aserrors.AsType).
  2. The Backend/Instance refactor.

Does this PR introduce a user-facing change?

NONE

🤖 Generated with Claude Code

Style cleanup: replace tea.String(x) with the new(x) builtin and errors.As
with errors.AsType in the VSC package.
@kubernetes-prow kubernetes-prow Bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jul 5, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: huww98
Once this PR has been reviewed and has the lgtm label, please assign albeeso for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot requested a review from mowangdk July 5, 2026 03:47
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 5, 2026
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.
@huww98 huww98 force-pushed the refactor/bmcpfs-vsc-backend branch from 3a6a681 to 22f33e0 Compare July 5, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant