Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions agent/csi/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
12 changes: 6 additions & 6 deletions manager/csi/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
Expand Down