mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
Update golangci-lint version to v1.21.0
Signed-off-by: Woohyung Han <techhanx@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
118f34525e
commit
8a16f740d6
@ -295,7 +295,6 @@ func (cs *ControllerServer) ValidateVolumeCapabilities(
|
||||
|
||||
// ExpandVolume expand CephFS Volumes on demand based on resizer request
|
||||
func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
|
||||
|
||||
if err := cs.validateExpandVolumeRequest(req); err != nil {
|
||||
klog.Errorf("ControllerExpandVolumeRequest validation failed: %v", err)
|
||||
return nil, err
|
||||
@ -335,5 +334,4 @@ func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi
|
||||
CapacityBytes: RoundOffSize,
|
||||
NodeExpansionRequired: false,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
@ -91,7 +91,6 @@ func NewNodeServer(d *csicommon.CSIDriver, t string) *NodeServer {
|
||||
// Run start a non-blocking grpc controller,node and identityserver for
|
||||
// ceph CSI driver which can serve multiple parallel requests
|
||||
func (fs *Driver) Run(conf *util.Config, cachePersister util.CachePersister) {
|
||||
|
||||
// Configuration
|
||||
PluginFolder = conf.PluginPath
|
||||
|
||||
|
@ -163,7 +163,6 @@ func (*NodeServer) mount(ctx context.Context, volOptions *volumeOptions, req *cs
|
||||
// NodePublishVolume mounts the volume mounted to the staging path to the target
|
||||
// path
|
||||
func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
|
||||
|
||||
mountOptions := []string{"bind"}
|
||||
if err := util.ValidateNodePublishVolumeRequest(req); err != nil {
|
||||
return nil, err
|
||||
|
@ -88,7 +88,6 @@ func (d *CSIDriver) AddControllerServiceCapabilities(cl []csi.ControllerServiceC
|
||||
}
|
||||
|
||||
d.cap = csc
|
||||
|
||||
}
|
||||
|
||||
// AddVolumeCapabilityAccessModes stores volume access modes
|
||||
|
@ -81,7 +81,6 @@ func (ns *DefaultNodeServer) NodeGetCapabilities(ctx context.Context, req *csi.N
|
||||
|
||||
// NodeGetVolumeStats returns volume stats
|
||||
func (ns *DefaultNodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
|
||||
|
||||
var err error
|
||||
targetPath := req.GetVolumePath()
|
||||
if targetPath == "" {
|
||||
@ -144,7 +143,6 @@ func (ns *DefaultNodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.No
|
||||
if !ok {
|
||||
klog.Errorf(util.Log(ctx, "failed to fetch available inodes"))
|
||||
return nil, status.Error(codes.Unknown, "failed to fetch available inodes")
|
||||
|
||||
}
|
||||
inodesFree, ok := (*(volMetrics.InodesFree)).AsInt64()
|
||||
if !ok {
|
||||
@ -171,5 +169,4 @@ func (ns *DefaultNodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.No
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ type nonBlockingGRPCServer struct {
|
||||
|
||||
// Start start service on endpoint
|
||||
func (s *nonBlockingGRPCServer) Start(endpoint, hstOptions string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer, metrics bool) {
|
||||
|
||||
s.wg.Add(1)
|
||||
go s.serve(endpoint, hstOptions, ids, cs, ns, metrics)
|
||||
}
|
||||
@ -77,7 +76,6 @@ func (s *nonBlockingGRPCServer) ForceStop() {
|
||||
}
|
||||
|
||||
func (s *nonBlockingGRPCServer) serve(endpoint, hstOptions string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer, metrics bool) {
|
||||
|
||||
proto, addr, err := parseEndpoint(endpoint)
|
||||
if err != nil {
|
||||
klog.Fatal(err.Error())
|
||||
|
@ -171,7 +171,6 @@ func panicHandler(ctx context.Context, req interface{}, info *grpc.UnaryServerIn
|
||||
klog.Errorf("panic occurred: %v", r)
|
||||
debug.PrintStack()
|
||||
err = status.Errorf(codes.Internal, "panic %v", r)
|
||||
|
||||
}
|
||||
}()
|
||||
return handler(ctx, req)
|
||||
|
@ -38,7 +38,6 @@ var (
|
||||
)
|
||||
|
||||
func getLiveness(timeout time.Duration, csiConn *grpc.ClientConn) {
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
|
||||
|
@ -118,7 +118,6 @@ func (cs *ControllerServer) parseVolCreateRequest(ctx context.Context, req *csi.
|
||||
|
||||
// CreateVolume creates the volume in backend
|
||||
func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
|
||||
|
||||
if err := cs.validateVolumeReq(ctx, req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -236,7 +236,6 @@ func (ns *NodeServer) createStageMountPoint(ctx context.Context, mountPath strin
|
||||
// NodePublishVolume mounts the volume mounted to the device path to the target
|
||||
// path
|
||||
func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
|
||||
|
||||
err := util.ValidateNodePublishVolumeRequest(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -408,7 +407,6 @@ func (ns *NodeServer) createTargetMountPath(ctx context.Context, mountPath strin
|
||||
}
|
||||
}
|
||||
return notMnt, err
|
||||
|
||||
}
|
||||
|
||||
// NodeUnpublishVolume unmounts the volume from the target path
|
||||
|
@ -70,7 +70,6 @@ func (nc *NodeCache) ForAll(pattern string, destObj interface{}, f ForAllFunc) e
|
||||
}
|
||||
}
|
||||
return err
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -93,12 +92,10 @@ func decodeObj(fpath, pattern string, file os.FileInfo, destObj interface{}) err
|
||||
if err = decoder.Decode(destObj); err != nil {
|
||||
if err = fp.Close(); err != nil {
|
||||
return errors.Wrapf(err, "failed to close file %s", file.Name())
|
||||
|
||||
}
|
||||
return errors.Wrapf(err, "node-cache: couldn't decode file %s", file.Name())
|
||||
}
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
// Create creates the metadata file in cache directory with identifier name
|
||||
@ -161,7 +158,6 @@ func (nc *NodeCache) Delete(identifier string) error {
|
||||
}
|
||||
|
||||
return errors.Wrapf(err, "node-cache: error removing file %s", file)
|
||||
|
||||
}
|
||||
klog.V(4).Infof("node-cache: successfully deleted metadata storage file at: %+v\n", file)
|
||||
return nil
|
||||
|
@ -296,7 +296,6 @@ func reserveOMapName(ctx context.Context, monitors string, cr *Credentials, pool
|
||||
}
|
||||
|
||||
return "", errors.New("uuid conflicts exceeds retry threshold")
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user