Skip to content

fix(storage-cli): avoid copying CSI publish requests - #907

Open
RedZapdos123 wants to merge 1 commit into
openkruise:masterfrom
RedZapdos123:fix-storage-cli-csi-copylocks
Open

fix(storage-cli): avoid copying CSI publish requests#907
RedZapdos123 wants to merge 1 commit into
openkruise:masterfrom
RedZapdos123:fix-storage-cli-csi-copylocks

Conversation

@RedZapdos123

@RedZapdos123 RedZapdos123 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Description:

Avoid copying csi.NodePublishVolumeRequest through the storage CLI mount path.

Before this change, runMount, validateGeneralParams, Provider.Validate, Provider.Mount, and RunNodePublishVolume passed csi.NodePublishVolumeRequest by value. After github.com/container-storage-interface/spec moved to v1.13.0, the regenerated protobuf embedded protoimpl.MessageState, so those copies started tripping go vet copylocks diagnostics and made make vet fail on main.

This PR switches that request plumbing to *csi.NodePublishVolumeRequest and updates the affected tests and fakes to match. Runtime behavior stays the same, but the storage CLI path no longer violates the protobuf no-copy contract. Fixes #905.

Validation Tests run:

  • GOTOOLCHAIN=go1.25.9 go test ./pkg/agent-runtime/storage-cli/... -count=1
  • GOTOOLCHAIN=go1.25.9 go vet ./pkg/agent-runtime/storage-cli/...
  • GOTOOLCHAIN=go1.25.9 go vet ./...
  • GOTOOLCHAIN=go1.25.9 make vet

Notes:

  • Scope is intentionally limited to the storage CLI CSI publish-request path.
  • No functional behavior change is intended beyond removing the by-value protobuf copies that were breaking go vet.

@kruise-bot
kruise-bot requested review from AiRanthem and zmberg August 31, 2026 13:25
@kruise-bot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign airanthem for approval by writing /assign @airanthem in a comment. For more information see:The Kubernetes 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

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.93%. Comparing base (0e3d344) to head (6c51062).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #907      +/-   ##
==========================================
- Coverage   82.94%   82.93%   -0.01%     
==========================================
  Files         259      259              
  Lines       22403    22403              
==========================================
- Hits        18582    18580       -2     
- Misses       3113     3115       +2     
  Partials      708      708              
Flag Coverage Δ
unittests 82.93% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@RedZapdos123
RedZapdos123 force-pushed the fix-storage-cli-csi-copylocks branch from 15cbb0c to 6c51062 Compare September 1, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants