nfs: address golangci-lint issues

addressing golangci-lint issues for
the nfs code.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2024-04-04 10:54:24 +02:00 committed by mergify[bot]
parent 4b7cafe821
commit 48d2e2ce2d
2 changed files with 9 additions and 9 deletions

View File

@ -84,9 +84,9 @@ func (cs *Server) CreateVolume(
return nil, err return nil, err
} }
backend := res.Volume backend := res.GetVolume()
log.DebugLog(ctx, "CephFS volume created: %s", backend.VolumeId) log.DebugLog(ctx, "CephFS volume created: %s", backend.GetVolumeId())
secret := req.GetSecrets() secret := req.GetSecrets()
cr, err := util.NewAdminCredentials(secret) cr, err := util.NewAdminCredentials(secret)
@ -97,7 +97,7 @@ func (cs *Server) CreateVolume(
} }
defer cr.DeleteCredentials() defer cr.DeleteCredentials()
nfsVolume, err := NewNFSVolume(ctx, backend.VolumeId) nfsVolume, err := NewNFSVolume(ctx, backend.GetVolumeId())
if err != nil { if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error()) return nil, status.Error(codes.InvalidArgument, err.Error())
} }

View File

@ -127,12 +127,12 @@ func (nv *NFSVolume) CreateExport(backend *csi.Volume) error {
if !nv.connected { if !nv.connected {
return fmt.Errorf("can not created export for %q: %w", nv, ErrNotConnected) return fmt.Errorf("can not created export for %q: %w", nv, ErrNotConnected)
} }
vctx := backend.GetVolumeContext()
fs := backend.VolumeContext["fsName"] fs := vctx["fsName"]
nfsCluster := backend.VolumeContext["nfsCluster"] nfsCluster := vctx["nfsCluster"]
path := backend.VolumeContext["subvolumePath"] path := vctx["subvolumePath"]
secTypes := backend.VolumeContext["secTypes"] secTypes := vctx["secTypes"]
clients := backend.VolumeContext["clients"] clients := vctx["clients"]
err := nv.setNFSCluster(nfsCluster) err := nv.setNFSCluster(nfsCluster)
if err != nil { if err != nil {