diff --git a/agent/csi/plugin/plugin.go b/agent/csi/plugin/plugin.go index a721ac25a8..f219c3a092 100644 --- a/agent/csi/plugin/plugin.go +++ b/agent/csi/plugin/plugin.go @@ -125,7 +125,7 @@ func (np *nodePlugin) connect(ctx context.Context) error { return np.init(ctx) } -func (np *nodePlugin) Client(ctx context.Context) (csi.NodeClient, error) { +func (np *nodePlugin) client(ctx context.Context) (csi.NodeClient, error) { if np.nodeClient == nil { if err := np.connect(ctx); err != nil { return nil, err @@ -143,7 +143,7 @@ func (np *nodePlugin) init(ctx context.Context) error { return status.Error(codes.FailedPrecondition, "Plugin is not Ready") } - c, err := np.Client(ctx) + c, err := np.client(ctx) if err != nil { return err } @@ -187,7 +187,7 @@ func (np *nodePlugin) GetPublishedPath(volumeID string) string { } func (np *nodePlugin) NodeGetInfo(ctx context.Context) (*api.NodeCSIInfo, error) { - c, err := np.Client(ctx) + c, err := np.client(ctx) if err != nil { return nil, err } @@ -214,7 +214,7 @@ func (np *nodePlugin) NodeStageVolume(ctx context.Context, req *api.VolumeAssign return err } - c, err := np.Client(ctx) + c, err := np.client(ctx) if err != nil { return err } @@ -256,7 +256,7 @@ func (np *nodePlugin) NodeUnstageVolume(ctx context.Context, req *api.VolumeAssi return status.Error(codes.FailedPrecondition, "VolumeID missing in request") } - c, err := np.Client(ctx) + c, err := np.client(ctx) if err != nil { return err } @@ -307,7 +307,7 @@ func (np *nodePlugin) NodePublishVolume(ctx context.Context, req *api.VolumeAssi return status.Error(codes.FailedPrecondition, "volume requires staging but was not staged") } - c, err := np.Client(ctx) + c, err := np.client(ctx) if err != nil { return err } @@ -349,7 +349,7 @@ func (np *nodePlugin) NodeUnpublishVolume(ctx context.Context, req *api.VolumeAs defer np.mu.Unlock() publishTarget := publishPath(req) - c, err := np.Client(ctx) + c, err := np.client(ctx) if err != nil { return err } diff --git a/manager/csi/plugin.go b/manager/csi/plugin.go index 0aacdb33cd..a59d84b4a3 100644 --- a/manager/csi/plugin.go +++ b/manager/csi/plugin.go @@ -164,7 +164,7 @@ func (p *plugin) init(ctx context.Context) error { // CreateVolume wraps and abstracts the CSI CreateVolume logic and returns // the volume info, or an error. func (p *plugin) CreateVolume(ctx context.Context, v *api.Volume) (*api.VolumeInfo, error) { - c, err := p.Client(ctx) + c, err := p.client(ctx) if err != nil { return nil, err } @@ -195,7 +195,7 @@ func (p *plugin) DeleteVolume(ctx context.Context, v *api.Volume) error { VolumeId: v.VolumeInfo.VolumeID, Secrets: secrets, } - c, err := p.Client(ctx) + c, err := p.client(ctx) if err != nil { return err } @@ -218,7 +218,7 @@ func (p *plugin) PublishVolume(ctx context.Context, v *api.Volume, nodeID string } req := p.makeControllerPublishVolumeRequest(v, nodeID) - c, err := p.Client(ctx) + c, err := p.client(ctx) if err != nil { return nil, err } @@ -239,7 +239,7 @@ func (p *plugin) UnpublishVolume(ctx context.Context, v *api.Volume, nodeID stri } req := p.makeControllerUnpublishVolumeRequest(v, nodeID) - c, err := p.Client(ctx) + c, err := p.client(ctx) if err != nil { return err } @@ -266,12 +266,12 @@ func (p *plugin) RemoveNode(swarmID string) { delete(p.csiToSwarm, csiID) } -// Client retrieves a csi.ControllerClient for this plugin +// client retrieves a csi.ControllerClient for this plugin // // If this is the first time client has been called and no client yet exists, // it will initialize the gRPC connection to the remote plugin and create a new // ControllerClient. -func (p *plugin) Client(ctx context.Context) (csi.ControllerClient, error) { +func (p *plugin) client(ctx context.Context) (csi.ControllerClient, error) { if p.controllerClient == nil { if err := p.connect(ctx); err != nil { return nil, err