Skip to content

manager/csi,agent/csi: narrow CSI client interfaces - #3256

Open
thaJeztah wants to merge 1 commit into
moby:masterfrom
thaJeztah:decouple_csi
Open

manager/csi,agent/csi: narrow CSI client interfaces#3256
thaJeztah wants to merge 1 commit into
moby:masterfrom
thaJeztah:decouple_csi

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Define local interfaces containing only the CSI RPCs used by the manager and agent plugins instead of depending directly on the generated gRPC client interfaces.

This avoids coupling the packages and their tests to unrelated RPCs added to the upstream CSI interfaces while retaining compile-time verification that the generated clients satisfy the local interfaces.

As part of this change, unexport the client methods that were only exported to satisfy the generated CSI interfaces, and remove unused fake methods from the tests.

- What I did

- How I did it

- How to test it

- Description for the changelog

@codecov-commenter

codecov-commenter commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.74%. Comparing base (6e9e7b8) to head (760b8e8).
⚠️ Report is 23 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3256      +/-   ##
==========================================
+ Coverage   14.73%   14.74%   +0.01%     
==========================================
  Files         200      200              
  Lines       93077    93094      +17     
==========================================
+ Hits        13712    13730      +18     
+ Misses      78019    78015       -4     
- Partials     1346     1349       +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thaJeztah
thaJeztah marked this pull request as ready for review July 25, 2026 17:20
@thaJeztah

Copy link
Copy Markdown
Member Author

@corhere @dperny @vvoland PTAL 🤗

Define local interfaces containing only the CSI RPCs used by the manager and
agent plugins instead of depending directly on the generated gRPC client
interfaces.

This avoids coupling the packages and their tests to unrelated RPCs added to
the upstream CSI interfaces while retaining compile-time verification that the
generated clients satisfy the local interfaces.

As part of this change, unexport the client methods that were only exported to
satisfy the generated CSI interfaces, and remove unused fake methods from the
tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

@corhere corhere left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just embed the interface into the fake structs? Maintaining our own subset interfaces is a lot of ceremony just so tests fail to build rather than panic at runtime when a needed method isn't faked.

// manager/csi/fakes_test.go
type fakeIdentityClient struct {
        csi.IdentityClient
        caps []*csi.PluginCapability
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants