From 61a2f12446c2fbed9dbd9a8b2884733ea0efa47b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 1 Aug 2026 16:55:05 +0200 Subject: [PATCH] manager/csi: fakeIdentityClient, fakeControllerClient: embed interface Make sure the fake clients satisfies the CSI interface if new methods are added to it that are unused in SwarmKit's implementation. Also remove the GetPluginInfo stub method, as it's not used in SwarmKit's implementation. Signed-off-by: Sebastiaan van Stijn --- manager/csi/fakes_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/manager/csi/fakes_test.go b/manager/csi/fakes_test.go index f8e5f70d88..aa55c72e29 100644 --- a/manager/csi/fakes_test.go +++ b/manager/csi/fakes_test.go @@ -40,6 +40,7 @@ func (f *fakeSecretProvider) GetSecret(id string) *api.Secret { // fakeIdentityClient implements the csi IdentityClient interface. type fakeIdentityClient struct { + csi.IdentityClient caps []*csi.PluginCapability } @@ -66,10 +67,6 @@ func newFakeIdentityClient() *fakeIdentityClient { } } -func (f *fakeIdentityClient) GetPluginInfo(ctx context.Context, _ *csi.GetPluginInfoRequest, _ ...grpc.CallOption) (*csi.GetPluginInfoResponse, error) { - return &csi.GetPluginInfoResponse{Name: "plugin", VendorVersion: "1"}, nil -} - func (f *fakeIdentityClient) GetPluginCapabilities(ctx context.Context, _ *csi.GetPluginCapabilitiesRequest, _ ...grpc.CallOption) (*csi.GetPluginCapabilitiesResponse, error) { return &csi.GetPluginCapabilitiesResponse{ Capabilities: f.caps, @@ -85,6 +82,7 @@ func (f *fakeIdentityClient) Probe(ctx context.Context, in *csi.ProbeRequest, _ } type fakeControllerClient struct { + csi.ControllerClient volumes map[string]*csi.Volume namesToIds map[string]string publisher bool